summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/cbfstool/cbfstool.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 26e443364f..3c6db6f231 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -192,7 +192,14 @@ static int cbfs_create(int argc, char **argv)
return 1;
}
- uint32_t size = strtoul(argv[3], NULL, 0);
+ char* suffix;
+ uint32_t size = strtoul(argv[3], &suffix, 0);
+ if (tolower(suffix[0])=='k') {
+ size *= 1024;
+ }
+ if (tolower(suffix[0])=='m') {
+ size *= 1024 * 1024;
+ }
char *bootblock = argv[4];
uint32_t align = 0;