From: Ari Johnson Date: Tue, 4 Sep 2007 04:52:38 +0000 (+0000) Subject: Fixed a potential crash bug in trim_space_sep X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=3da9298f3c573a7defaa9835db7642a5cfca3bc1;p=cobramush.git Fixed a potential crash bug in trim_space_sep (cherry picked from commit 28d74365889a3091c9fadba791353f1184ac8139) --- diff --git a/src/strutil.c b/src/strutil.c index 4eaa680..cdb0713 100644 --- 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;