diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-02-28 03:36:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-02-28 03:36:49 +0100 |
commit | 0b170e6a096b0d5010e29a39f3b270c3a7bc4945 (patch) | |
tree | b7590773a2c1f92cba6162d79bd753beb8ad9221 | |
parent | 694738f4eb26e8c46e72be7f9c0be64b3a785161 (diff) | |
download | busybox-w32-0b170e6a096b0d5010e29a39f3b270c3a7bc4945.tar.gz busybox-w32-0b170e6a096b0d5010e29a39f3b270c3a7bc4945.tar.bz2 busybox-w32-0b170e6a096b0d5010e29a39f3b270c3a7bc4945.zip |
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>
-rw-r--r-- | libbb/procps.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index 0e3f2f9da..c06ff1d70 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -127,7 +127,8 @@ static unsigned long fast_strtoul_16(char **endptr) | |||
127 | char *str = *endptr; | 127 | char *str = *endptr; |
128 | unsigned long n = 0; | 128 | unsigned long n = 0; |
129 | 129 | ||
130 | while ((c = *str++) != ' ') { | 130 | /* need to stop on both ' ' and '\n' */ |
131 | while ((c = *str++) > ' ') { | ||
131 | c = ((c|0x20) - '0'); | 132 | c = ((c|0x20) - '0'); |
132 | if (c > 9) | 133 | if (c > 9) |
133 | // c = c + '0' - 'a' + 10: | 134 | // c = c + '0' - 'a' + 10: |