[git commit] fdisk: fix GPT size math errors

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 20 15:42:06 UTC 2013


commit: http://git.busybox.net/busybox/commit/?id=deebdf59b5cd8cba5a44a6a4fa9a90a87969a181
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Jody Bruchon <jody at jodybruchon.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/fdisk_gpt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c
index d43d9c7..f45f68a 100644
--- a/util-linux/fdisk_gpt.c
+++ b/util-linux/fdisk_gpt.c
@@ -95,7 +95,7 @@ gpt_list_table(int xtra UNUSED_PARAM)
 
 	numstr6[5] = '\0';
 
-	smart_ulltoa5(total_number_of_sectors, numstr6, " KMGTPEZY");
+	smart_ulltoa5(total_number_of_sectors * sector_size, numstr6, " KMGTPEZY");
 	printf("Disk %s: %llu sectors, %s\n", disk_device,
 		(unsigned long long)total_number_of_sectors,
 		numstr6);
@@ -112,7 +112,7 @@ gpt_list_table(int xtra UNUSED_PARAM)
 	for (i = 0; i < n_parts; i++) {
 		gpt_partition *p = gpt_part(i);
 		if (p->lba_start) {
-			smart_ulltoa5(1 + SWAP_LE64(p->lba_end) - SWAP_LE64(p->lba_start),
+			smart_ulltoa5((1 + SWAP_LE64(p->lba_end) - SWAP_LE64(p->lba_start)) * sector_size,
 				numstr6, " KMGTPEZY");
 			printf("%4u %15llu %15llu %11s   %04x  ",
 				i + 1,


More information about the busybox-cvs mailing list