diff --git a/config.c b/config.c index 9e2b67ea..7c2d0014 100644 --- a/config.c +++ b/config.c @@ -185,6 +185,10 @@ trim(char *s) char *s1 = s, *s2 = &s[strlen(s) - 1]; + /* If string is empty, no action needed */ + if(s2 < s1) + return s; + /* Trim and delimit right side */ while ((isspace(*s2)) && (s2 >= s1)) --s2;