aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/procps.c3
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)
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: