diff options
| author | 2010-02-28 23:55:20 -0800 | |
|---|---|---|
| committer | 2010-02-28 23:55:20 -0800 | |
| commit | 35858adbfca13678af99fb31618ef4428d6dedb0 (patch) | |
| tree | 3336feaa61324486945816cb52c347733e7c0821 /lib/parser.c | |
| parent | Input: winbond-cir - fix suspend/resume (diff) | |
| parent | Input: atkbd - release previously reserved keycodes 248 - 254 (diff) | |
| download | wireguard-linux-35858adbfca13678af99fb31618ef4428d6dedb0.tar.xz wireguard-linux-35858adbfca13678af99fb31618ef4428d6dedb0.zip | |
Merge branch 'next' into for-linus
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 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[]) 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; |
