diff --git a/util.c b/util.c index cb966d4..8cea883 100644 --- a/util.c +++ b/util.c @@ -60,8 +60,7 @@ static void trim(char *s) { char *e; - e = s + strlen(s) - 1; - while(e > s && isspace((unsigned char)*e)) - e--; - *(e + 1) = '\0'; + for (e = s + strlen(s); e > s && isspace((unsigned char)*(e - 1)); e--) + ; + *e = '\0'; }