From 452cc854e5d0daa06fd4cd1aee2bf1dc933d4672 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 2d6e605..5e91e4b 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