diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-04 16:45:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-10-04 16:45:04 +0200 |
commit | d8e4ce05039a89c2e0b41f008d74a83db45f2287 (patch) | |
tree | 147536311a6c19a12b331b02dd6b2819b48fae23 /util-linux/fdisk_osf.c | |
parent | 65741d004ee91c5a710559ae4f1664f25009255e (diff) | |
download | busybox-w32-d8e4ce05039a89c2e0b41f008d74a83db45f2287.tar.gz busybox-w32-d8e4ce05039a89c2e0b41f008d74a83db45f2287.tar.bz2 busybox-w32-d8e4ce05039a89c2e0b41f008d74a83db45f2287.zip |
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_osf.c')
-rw-r--r-- | util-linux/fdisk_osf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index 1328c1fcd..92180b2bc 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c | |||
@@ -470,7 +470,7 @@ xbsd_new_part(void) | |||
470 | end = xbsd_dlabel.d_secperunit - 1; | 470 | end = xbsd_dlabel.d_secperunit - 1; |
471 | #endif | 471 | #endif |
472 | 472 | ||
473 | snprintf(mesg, sizeof(mesg), "First %s", str_units(SINGULAR)); | 473 | snprintf(mesg, sizeof(mesg), "First %s", str_units()); |
474 | begin = read_int(bsd_cround(begin), bsd_cround(begin), bsd_cround(end), | 474 | begin = read_int(bsd_cround(begin), bsd_cround(begin), bsd_cround(end), |
475 | 0, mesg); | 475 | 0, mesg); |
476 | 476 | ||
@@ -478,7 +478,7 @@ xbsd_new_part(void) | |||
478 | begin = (begin - 1) * xbsd_dlabel.d_secpercyl; | 478 | begin = (begin - 1) * xbsd_dlabel.d_secpercyl; |
479 | 479 | ||
480 | snprintf(mesg, sizeof(mesg), "Last %s or +size or +sizeM or +sizeK", | 480 | snprintf(mesg, sizeof(mesg), "Last %s or +size or +sizeM or +sizeK", |
481 | str_units(SINGULAR)); | 481 | str_units()); |
482 | end = read_int(bsd_cround(begin), bsd_cround(end), bsd_cround(end), | 482 | end = read_int(bsd_cround(begin), bsd_cround(end), bsd_cround(end), |
483 | bsd_cround(begin), mesg); | 483 | bsd_cround(begin), mesg); |
484 | 484 | ||