fdisk: avoid overflow in "mega/gigabytes" calculation, code shrink
function old new delta
list_disk_geometry 175 145 -30
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index 1328c1f..92180b2 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -470,7 +470,7 @@
end = xbsd_dlabel.d_secperunit - 1;
#endif
- snprintf(mesg, sizeof(mesg), "First %s", str_units(SINGULAR));
+ snprintf(mesg, sizeof(mesg), "First %s", str_units());
begin = read_int(bsd_cround(begin), bsd_cround(begin), bsd_cround(end),
0, mesg);
@@ -478,7 +478,7 @@
begin = (begin - 1) * xbsd_dlabel.d_secpercyl;
snprintf(mesg, sizeof(mesg), "Last %s or +size or +sizeM or +sizeK",
- str_units(SINGULAR));
+ str_units());
end = read_int(bsd_cround(begin), bsd_cround(end), bsd_cround(end),
bsd_cround(begin), mesg);