Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176377
b: refs/heads/master
c: b5f54b0
h: refs/heads/master
i:
  176375: 7d4e488
v: v3
  • Loading branch information
André Goddard Rosa authored and Linus Torvalds committed Dec 15, 2009
1 parent 408cb30 commit 28648ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7d2860b690d4f3bed6824757c540579638e3d1e
refs/heads/master: b5f54b07c06f6e438a4fee92c27423e880d8816b
11 changes: 7 additions & 4 deletions trunk/lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 28648ed

Please sign in to comment.