From ffc4374869b9ac10539a3c18e13b29d1b0c64484 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:53 +0100 Subject: Imported from util-linux-2.11o tarball. --- fdisk/cfdisk.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'fdisk/cfdisk.c') diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c index 656b1aea0..d69dba5e3 100644 --- a/fdisk/cfdisk.c +++ b/fdisk/cfdisk.c @@ -2569,8 +2569,16 @@ draw_screen(void) { mvaddstr(HEADER_START, (COLS-strlen(line))/2, line); sprintf(line, _("Disk Drive: %s"), disk_device); mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line); - { long long bytes = actual_size*(long long) SECTOR_SIZE; - sprintf(line, _("Size: %lld bytes"), bytes); } + { + long long bytes = actual_size*(long long) SECTOR_SIZE; + long megabytes = bytes/1000000; + if (megabytes < 10000) + sprintf(line, _("Size: %lld bytes, %ld MB"), + bytes, megabytes); + else + sprintf(line, _("Size: %lld bytes, %ld.%ld GB"), + bytes, megabytes/1000, (megabytes/100)%10); + } mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line); sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %d"), heads, sectors, cylinders); @@ -2844,7 +2852,7 @@ main(int argc, char **argv) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - while ((c = getopt(argc, argv, "ac:gh:s:vzP:")) != EOF) + while ((c = getopt(argc, argv, "ac:gh:s:vzP:")) != -1) switch (c) { case 'a': arrow_cursor = TRUE; -- cgit v1.2.3-55-g7522