From 904adb80d40eed1d6b527290714b233e8c37cb35 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 17 Dec 2012 16:48:24 +0100 Subject: [PATCH] lib: misc: add 'iB' suffixes to strtoull_suffix Since this is the 'official' notation, we should support it. Signed-off-by: Wolfram Sang Signed-off-by: Sascha Hauer --- lib/misc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/misc.c b/lib/misc.c index 1a08502eb..0f3eb9aab 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; }