aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parser.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-12-28 03:23:13 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-28 03:23:13 -0500
commit605c1a187f3ce82fbc243e2163c5ca8d1926df8e (patch)
treec8065a8c5606a66f81dc494ce22a5baa5e0dfe7e /lib/parser.c
parent17a2a9b57a9a7d2fd8f97df951b5e63e0bd56ef5 (diff)
parentce9277fb08e6e721482f7011ca28dcd0449b197c (diff)
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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/parser.c b/lib/parser.c
index b00d02059a5f..fb34977246bb 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[])
56 56
57 args[argc].from = s; 57 args[argc].from = s;
58 switch (*p++) { 58 switch (*p++) {
59 case 's': 59 case 's': {
60 if (strlen(s) == 0) 60 size_t str_len = strlen(s);
61
62 if (str_len == 0)
61 return 0; 63 return 0;
62 else if (len == -1 || len > strlen(s)) 64 if (len == -1 || len > str_len)
63 len = strlen(s); 65 len = str_len;
64 args[argc].to = s + len; 66 args[argc].to = s + len;
65 break; 67 break;
68 }
66 case 'd': 69 case 'd':
67 simple_strtol(s, &args[argc].to, 0); 70 simple_strtol(s, &args[argc].to, 0);
68 goto num; 71 goto num;