projects
/
cobramush.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2897979
)
Fixed a potential crash bug in trim_space_sep
author
Ari Johnson
<ari@cobramush.org>
Tue, 4 Sep 2007 04:52:38 +0000
(
04:52
+0000)
committer
Ari Johnson
<ari@cobramush.org>
Wed, 4 Apr 2007 05:49:46 +0000
(
05:49
+0000)
(cherry picked from commit
28d74365889a3091c9fadba791353f1184ac8139
)
src/strutil.c
patch
|
blob
|
history
diff --git
a/src/strutil.c
b/src/strutil.c
index 2d6e6051945dca65e150f3f08164556251fb3e23..5e91e4b09b2fa940c61b4f9dc2dd845c5353496e 100644
(file)
--- a/
src/strutil.c
+++ b/
src/strutil.c
@@
-1017,7
+1017,7
@@
trim_space_sep(char *str, char sep)
str += strspn(str, " ");
for (p = str; *p; p++) ;
/* And trailing */
- for (p--; (
*p == ' ') && (p > str
); p--) ;
+ for (p--; (
p > str) && (*p == ' '
); p--) ;
p++;
*p = '\0';
return str;