summaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-16 16:52:45 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-16 16:52:45 +0200
commit396643e2cbf05cdc3d2a8fa34cf2d4f8cc1d8441 (patch)
treeed1ff41d4be4a754673a4ffd6f22c850ffe064df /ubi-utils
parentd468b5c78dea0b764e59f72caedeb5fd98dd7b67 (diff)
ubi-utils: fix bytes output
Fix incorrect output of ubinfo like "Amount of available logical eraseblocks: 00 bytes)" which should look like "Amount of available logical eraseblocks: 0 (0 bytes)" Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/src/common.c2
-rw-r--r--ubi-utils/src/ubinfo.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ubi-utils/src/common.c b/ubi-utils/src/common.c
index 7ed1ade..f8110c3 100644
--- a/ubi-utils/src/common.c
+++ b/ubi-utils/src/common.c
@@ -79,7 +79,7 @@ void ubiutils_print_bytes(long long bytes, int bracket)
printf("%s%.1f GiB", p, (double)bytes / (1024 * 1024 * 1024));
else if (bytes > 1024 * 1024)
printf("%s%.1f MiB", p, (double)bytes / (1024 * 1024));
- else if (bytes > 1024)
+ else if (bytes > 1024 && bytes != 0)
printf("%s%.1f KiB", p, (double)bytes / 1024);
else
return;
diff --git a/ubi-utils/src/ubinfo.c b/ubi-utils/src/ubinfo.c
index 35c70a1..247e2eb 100644
--- a/ubi-utils/src/ubinfo.c
+++ b/ubi-utils/src/ubinfo.c
@@ -251,7 +251,7 @@ static int print_dev_info(libubi_t libubi, int dev_num, int all)
ubiutils_print_bytes(dev_info.total_bytes, 0);
printf(")\n");
- printf("Amount of available logical eraseblocks: %d", dev_info.avail_lebs);
+ printf("Amount of available logical eraseblocks: %d (", dev_info.avail_lebs);
ubiutils_print_bytes(dev_info.avail_bytes, 0);
printf(")\n");