projects
/
cobramush.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eeb0f3d
)
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@theari.com>
Thu, 24 Mar 2011 15:58:45 +0000
(15:58 +0000)
(cherry picked from commit
28d74365889a3091c9fadba791353f1184ac8139
)
src/strutil.c
patch
|
blob
|
history
diff --git
a/src/strutil.c
b/src/strutil.c
index 4eaa680d5b3f92fd4b54fd3bafe4ecd7cf03ebbe..cdb0713c61d721948b8aa24a6f183af2d6751a48 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;