diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-12-28 09:23:13 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-28 09:23:13 +0100 |
commit | 605c1a187f3ce82fbc243e2163c5ca8d1926df8e (patch) | |
tree | c8065a8c5606a66f81dc494ce22a5baa5e0dfe7e /lib/parser.c | |
parent | 17a2a9b57a9a7d2fd8f97df951b5e63e0bd56ef5 (diff) | |
parent | ce9277fb08e6e721482f7011ca28dcd0449b197c (diff) | |
download | op-kernel-dev-605c1a187f3ce82fbc243e2163c5ca8d1926df8e.zip op-kernel-dev-605c1a187f3ce82fbc243e2163c5ca8d1926df8e.tar.gz |
Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent
Diffstat (limited to 'lib/parser.c')
-rw-r--r-- | lib/parser.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/parser.c b/lib/parser.c index b00d020..fb34977 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -56,13 +56,16 @@ static int match_one(char *s, const char *p, substring_t args[]) args[argc].from = s; switch (*p++) { - case 's': - if (strlen(s) == 0) + case 's': { + size_t str_len = strlen(s); + + if (str_len == 0) return 0; - else if (len == -1 || len > strlen(s)) - len = strlen(s); + if (len == -1 || len > str_len) + len = str_len; args[argc].to = s + len; break; + } case 'd': simple_strtol(s, &args[argc].to, 0); goto num; |