Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217579
b: refs/heads/master
c: 5d051de
h: refs/heads/master
i:
  217577: c4b20c0
  217575: 62a28dd
v: v3
  • Loading branch information
Namhyung Kim authored and Linus Torvalds committed Oct 26, 2010
1 parent dbbb816 commit c1878cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: ea00c30b5b31baa91be29bee966204eccc15e9d3
refs/heads/master: 5d051decfc27cdf33fbbd2bfca958d0d2c903569
7 changes: 4 additions & 3 deletions trunk/lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ static int match_number(substring_t *s, int *result, int base)
char *endp;
char *buf;
int ret;
size_t len = s->to - s->from;

buf = kmalloc(s->to - s->from + 1, GFP_KERNEL);
buf = kmalloc(len + 1, GFP_KERNEL);
if (!buf)
return -ENOMEM;
memcpy(buf, s->from, s->to - s->from);
buf[s->to - s->from] = '\0';
memcpy(buf, s->from, len);
buf[len] = '\0';
*result = simple_strtol(buf, &endp, base);
ret = 0;
if (endp == buf)
Expand Down

0 comments on commit c1878cb

Please sign in to comment.