summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:53 +0100
committerKarel Zak2006-12-07 00:25:53 +0100
commitffc4374869b9ac10539a3c18e13b29d1b0c64484 (patch)
tree1b8054e83f7f70e8fa77499fc9246d1cc16faa15 /fdisk/cfdisk.c
parentImported from util-linux-2.11n tarball. (diff)
downloadkernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.gz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.xz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.zip
Imported from util-linux-2.11o tarball.
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c14
1 files changed, 11 insertions, 3 deletions
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;