aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorAndrĂ© Goddard Rosa <[email protected]>2009-12-15 02:01:04 +0000
committerLinus Torvalds <[email protected]>2009-12-15 16:53:32 +0000
commit84c95c9acf088c99d8793d78036b67faa5d0b851 (patch)
tree170c528099f4f570e48220b546c7fc3e4e06be8a /lib/string.c
parentstring: factorize skip_spaces and export it to be generally available (diff)
downloadkernel-84c95c9acf088c99d8793d78036b67faa5d0b851.tar.gz
kernel-84c95c9acf088c99d8793d78036b67faa5d0b851.zip
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]>
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string.c b/lib/string.c
index 3a912a4e9a63..765566a6a088 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -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);