tools: env: fw_string_blank: return from loop when item found
authorAndreas Fenkart <andreas.fenkart@digitalstrom.com>
Fri, 11 Mar 2016 08:39:36 +0000 (09:39 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 26 Mar 2016 22:49:29 +0000 (18:49 -0400)
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
tools/env/fw_env.c

index bded9f64c7bd43d5f91375aadf97720f6dc19008..0a438a3be427116432bbe88720d3ce7495b12113 100644 (file)
@@ -141,12 +141,9 @@ static char *fw_string_blank(char *s, int noblank)
        for (i = 0; i < len; i++, s++) {
                if ((noblank && !isblank(*s)) ||
                    (!noblank && isblank(*s)))
-                       break;
+                       return s;
        }
-       if (i == len)
-               return NULL;
-
-       return s;
+       return NULL;
 }
 
 /*