From 3da9298f3c573a7defaa9835db7642a5cfca3bc1 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Tue, 4 Sep 2007 04:52:38 +0000 Subject: [PATCH] Fixed a potential crash bug in trim_space_sep (cherry picked from commit 28d74365889a3091c9fadba791353f1184ac8139) --- src/strutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2