diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2012-12-17 16:48:24 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-19 10:30:56 +0100 |
commit | 904adb80d40eed1d6b527290714b233e8c37cb35 (patch) | |
tree | c93c848d005dd9bbe6dcb550089313314b775679 /lib/misc.c | |
parent | 1bd4283c0811c768188788302e889bc270420b70 (diff) | |
download | barebox-904adb80d40eed1d6b527290714b233e8c37cb35.tar.gz barebox-904adb80d40eed1d6b527290714b233e8c37cb35.tar.xz |
lib: misc: add 'iB' suffixes to strtoull_suffix
Since this is the 'official' notation, we should support it.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/misc.c')
-rw-r--r-- | lib/misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/misc.c b/lib/misc.c index 1a08502eb4..0f3eb9aabb 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -47,8 +47,11 @@ unsigned long long strtoull_suffix(const char *str, char **endp, int base) break; } + if (strncmp(end, "iB", 2) == 0) + end += 2; + if (endp) - *endp = (char *)end; + *endp = end; return val; } |