string: on strstrip(), first remove leading spaces before running over str

... so that strlen() iterates over a smaller string comprising of the
remaining characters only.

Signed-off-by: André Goddard Rosa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
André Goddard Rosa authored and Linus Torvalds committed 2009-12-15 08:53:32 -08:00
1 parent f653398c86
commit 84c95c9acf
1 file changed
+2 -2
+2 -2
View File
@@ -364,8 +364,8 @@ char *strstrip(char *s)
size_t size;
char *end;
s = skip_spaces(s);
size = strlen(s);
if (!size)
return s;
@@ -374,7 +374,7 @@ char *strstrip(char *s)
end--;
*(end + 1) = '\0';
return skip_spaces(s);
return s;
}
EXPORT_SYMBOL(strstrip);