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>
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;
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");