aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Bruchon <jody@jodybruchon.com>2013-08-20 17:42:06 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2013-08-20 17:42:06 +0200
commitdeebdf59b5cd8cba5a44a6a4fa9a90a87969a181 (patch)
treea6d14faef90a87f894ae94f8b3d3196daf56f805
parent1b9ac2116643e34a9dbfb67624aa2276480b4b6e (diff)
downloadbusybox-w32-deebdf59b5cd8cba5a44a6a4fa9a90a87969a181.tar.gz
busybox-w32-deebdf59b5cd8cba5a44a6a4fa9a90a87969a181.tar.bz2
busybox-w32-deebdf59b5cd8cba5a44a6a4fa9a90a87969a181.zip
fdisk: fix GPT size math errors
Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/fdisk_gpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c
index d43d9c709..f45f68af0 100644
--- a/util-linux/fdisk_gpt.c
+++ b/util-linux/fdisk_gpt.c
@@ -95,7 +95,7 @@ gpt_list_table(int xtra UNUSED_PARAM)
95 95
96 numstr6[5] = '\0'; 96 numstr6[5] = '\0';
97 97
98 smart_ulltoa5(total_number_of_sectors, numstr6, " KMGTPEZY"); 98 smart_ulltoa5(total_number_of_sectors * sector_size, numstr6, " KMGTPEZY");
99 printf("Disk %s: %llu sectors, %s\n", disk_device, 99 printf("Disk %s: %llu sectors, %s\n", disk_device,
100 (unsigned long long)total_number_of_sectors, 100 (unsigned long long)total_number_of_sectors,
101 numstr6); 101 numstr6);
@@ -112,7 +112,7 @@ gpt_list_table(int xtra UNUSED_PARAM)
112 for (i = 0; i < n_parts; i++) { 112 for (i = 0; i < n_parts; i++) {
113 gpt_partition *p = gpt_part(i); 113 gpt_partition *p = gpt_part(i);
114 if (p->lba_start) { 114 if (p->lba_start) {
115 smart_ulltoa5(1 + SWAP_LE64(p->lba_end) - SWAP_LE64(p->lba_start), 115 smart_ulltoa5((1 + SWAP_LE64(p->lba_end) - SWAP_LE64(p->lba_start)) * sector_size,
116 numstr6, " KMGTPEZY"); 116 numstr6, " KMGTPEZY");
117 printf("%4u %15llu %15llu %11s %04x ", 117 printf("%4u %15llu %15llu %11s %04x ",
118 i + 1, 118 i + 1,