Added some more '/* getopt not needed */' lines.
[oweals/busybox.git] / utility.c
index b4893a0e17c49cb0accf13b7ea99393ed0406594..092cfdb10d20b069fd135800e95ebd126badff91 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -1831,13 +1831,13 @@ void chomp(char *s)
 #if defined(BB_SH)
 void trim(char *s)
 {
+       /* trim trailing whitespace */
+       while (isspace(s[strlen(s)-1]))
+               s[strlen(s)-1]='\0';
+
        /* trim leading whitespace */
        memmove(s, &s[strspn(s, " \n\r\t\v")], strlen(s));
 
-       /* trim trailing whitespace */
-       while (*s && (!isspace (*s)))
-               s++;
-       *s='\0';
 }
 #endif