← Commit list

deebdf59b

Jody Bruchon
Jody Bruchon
2013-08-20
SUCCESS Duration: 182s

Subject

fdisk: fix GPT size math errors

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/fdisk_gpt.c+2 -2
@@ -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,