Based on patch by Paul B. Henson <henson@acm.org>
function old new delta
static.size_suffixes - 32 +32
ubi_tools_main 1141 1148 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
int ubi_tools_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ubi_tools_main(int argc UNUSED_PARAM, char **argv)
{
+ static const struct suffix_mult size_suffixes[] = {
+ { "KiB", 1024 },
+ { "MiB", 1024*1024 },
+ { "GiB", 1024*1024*1024 },
+ { "", 0 }
+ };
+
unsigned opts;
char *ubi_ctrl;
int fd;
#define OPTION_t (1 << 6)
if (opts & OPTION_s)
- size_bytes = xatoull(size_bytes_str);
+ size_bytes = xatoull_sfx(size_bytes_str, size_suffixes);
argv += optind;
ubi_ctrl = *argv++;