From 279fe0b437f777c1133d8421a94977a9f8867b12 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 20 Mar 2018 19:13:03 -0500 Subject: Minghui Liu pointed out that the b and c suffixes were reported as errors. --- lib/lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index 36c2028b..a6f9f987 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -302,10 +302,11 @@ long long atolx(char *numstr) if (c != numstr && *c && (end = strchr(suffixes, tolower(*c)))) { int shift = end-suffixes-2; + ++c; if (shift==-1) val *= 2; - if (!shift) val *= 512; + else if (!shift) val *= 512; else if (shift>0) { - if (toupper(*++c)=='d') while (shift--) val *= 1000; + if (toupper(*c)=='d') while (shift--) val *= 1000; else val *= 1LL<<(shift*10); } } -- cgit v1.2.3