projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
694738f
)
libbb/procps.c: make fast_strtoul_10() stop on '\n' too
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 28 Feb 2012 02:36:49 +0000
(
03:36
+0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 28 Feb 2012 02:36:49 +0000
(
03:36
+0100)
This is needed for parsing /proc data on linux 2.4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/procps.c
patch
|
blob
|
history
diff --git
a/libbb/procps.c
b/libbb/procps.c
index 0e3f2f9da2225809629e73ad0f1e3cfbb1e67a45..c06ff1d704eef7e02aa57da64129ed31555e0111 100644
(file)
--- a/
libbb/procps.c
+++ b/
libbb/procps.c
@@
-127,7
+127,8
@@
static unsigned long fast_strtoul_16(char **endptr)
char *str = *endptr;
unsigned long n = 0;
- while ((c = *str++) != ' ') {
+ /* need to stop on both ' ' and '\n' */
+ while ((c = *str++) > ' ') {
c = ((c|0x20) - '0');
if (c > 9)
// c = c + '0' - 'a' + 10: