libbb/procps.c: make fast_strtoul_10() stop on '\n' too
This is needed for parsing /proc data on linux 2.4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
694738f4eb
commit
0b170e6a09
@ -127,7 +127,8 @@ static unsigned long fast_strtoul_16(char **endptr)
|
|||||||
char *str = *endptr;
|
char *str = *endptr;
|
||||||
unsigned long n = 0;
|
unsigned long n = 0;
|
||||||
|
|
||||||
while ((c = *str++) != ' ') {
|
/* need to stop on both ' ' and '\n' */
|
||||||
|
while ((c = *str++) > ' ') {
|
||||||
c = ((c|0x20) - '0');
|
c = ((c|0x20) - '0');
|
||||||
if (c > 9)
|
if (c > 9)
|
||||||
// c = c + '0' - 'a' + 10:
|
// c = c + '0' - 'a' + 10:
|
||||||
|
Loading…
Reference in New Issue
Block a user