|
@@ -131,13 +131,10 @@ static int match_number(substring_t *s, int *result, int base)
|
|
|
char *buf;
|
|
|
int ret;
|
|
|
long val;
|
|
|
- size_t len = s->to - s->from;
|
|
|
|
|
|
- buf = kmalloc(len + 1, GFP_KERNEL);
|
|
|
+ buf = match_strdup(s);
|
|
|
if (!buf)
|
|
|
return -ENOMEM;
|
|
|
- memcpy(buf, s->from, len);
|
|
|
- buf[len] = '\0';
|
|
|
|
|
|
ret = 0;
|
|
|
val = simple_strtol(buf, &endp, base);
|