[PATCH V3 02/11] lib: misc: add 'iB' suffixes to strtoull_suffix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since this is the 'official' notation, we should support it.

Signed-off-by: Wolfram Sang <w.sang@xxxxxxxxxxxxxx>
---
 lib/misc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/misc.c b/lib/misc.c
index 1a08502..0f3eb9a 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;
 }
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux