diff options
author | Denys Vlasenko | 2019-10-04 16:45:04 +0200 |
---|---|---|
committer | Denys Vlasenko | 2019-10-04 16:45:04 +0200 |
commit | d8e4ce05039a89c2e0b41f008d74a83db45f2287 (patch) | |
tree | 147536311a6c19a12b331b02dd6b2819b48fae23 /util-linux/fdisk_sgi.c | |
parent | 65741d004ee91c5a710559ae4f1664f25009255e (diff) | |
download | busybox-d8e4ce05039a89c2e0b41f008d74a83db45f2287.zip busybox-d8e4ce05039a89c2e0b41f008d74a83db45f2287.tar.gz |
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>
Diffstat (limited to 'util-linux/fdisk_sgi.c')
-rw-r--r-- | util-linux/fdisk_sgi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c index 0e5491a..c90c801 100644 --- a/util-linux/fdisk_sgi.c +++ b/util-linux/fdisk_sgi.c @@ -295,19 +295,19 @@ sgi_list_table(int xtra) "%u cylinders, %u physical cylinders\n" "%u extra sects/cyl, interleave %u:1\n" "%s\n" - "Units = %s of %u * 512 bytes\n\n", + "Units = %ss of %u * 512 bytes\n\n", disk_device, g_heads, g_sectors, g_cylinders, SGI_SSWAP16(sgiparam.pcylcount), SGI_SSWAP16(sgiparam.sparecyl), SGI_SSWAP16(sgiparam.ilfact), (char *)sgilabel, - str_units(PLURAL), units_per_sector); + str_units(), units_per_sector); } else { printf("\nDisk %s (SGI disk label): " "%u heads, %u sectors, %u cylinders\n" - "Units = %s of %u * 512 bytes\n\n", + "Units = %ss of %u * 512 bytes\n\n", disk_device, g_heads, g_sectors, g_cylinders, - str_units(PLURAL), units_per_sector ); + str_units(), units_per_sector ); } w = strlen(disk_device); @@ -720,7 +720,7 @@ sgi_add_partition(int n, int sys) printf("You got a partition overlap on the disk. Fix it first!\n"); return; } - snprintf(mesg, sizeof(mesg), "First %s", str_units(SINGULAR)); + snprintf(mesg, sizeof(mesg), "First %s", str_units()); while (1) { if (sys == SGI_VOLUME) { last = sgi_get_lastblock(); @@ -746,7 +746,7 @@ sgi_add_partition(int n, int sys) printf("You will get a partition overlap on the disk. " "Fix it first!\n"); } - snprintf(mesg, sizeof(mesg), " Last %s", str_units(SINGULAR)); + snprintf(mesg, sizeof(mesg), " Last %s", str_units()); last = read_int(scround(first), scround(last)-1, scround(last)-1, scround(first), mesg)+1; if (display_in_cyl_units) |