]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: get_disksize() returns long long
authorPetr Uzel <petr.uzel@suse.cz>
Mon, 19 Sep 2011 13:29:12 +0000 (15:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Oct 2011 12:22:27 +0000 (14:22 +0200)
unsigned long is 4 bytes long on i586, which is not enough for big
HDD's with 512B sectors. Use unsigned long long, which is 8 bytes.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
fdisk/sfdisk.c

index e27a3200860e5ba92962ef7192d6abe175ca93b0..1b0fb9681603beadc03937672b44d4cda63c25ea 100644 (file)
@@ -928,7 +928,7 @@ unitsize(int format) {
     }
 }
 
-static unsigned long
+static unsigned long long
 get_disksize(int format) {
     if (B.total_size && leave_last)
        /* don't use last cylinder (--leave-last option) */
@@ -1266,7 +1266,7 @@ partitions_ok(struct disk_desc *z) {
 
     /* Do they start past zero and end before end-of-disk? */
     {
-       unsigned long ds = get_disksize(F_SECTOR);
+       unsigned long long ds = get_disksize(F_SECTOR);
        for (p = partitions; p < partitions + partno; p++)
            if (p->size) {
                if (p->start == 0) {
@@ -1926,7 +1926,7 @@ first_free(int pno, int is_extended, struct part_desc *ep, int format,
 static unsigned long
 max_length(int pno, int is_extended, struct part_desc *ep, int format,
           unsigned long start, struct disk_desc *z) {
-    unsigned long fu;
+    unsigned long long fu;
     unsigned long unit = unitsize(format);
     struct part_desc *partitions = &(z->partitions[0]), *pp = 0;