]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: Fix order of C/H/S numbers output
authorAndreas Henriksson <andreas@fatal.se>
Thu, 25 Feb 2016 10:26:53 +0000 (11:26 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Mar 2016 14:08:50 +0000 (15:08 +0100)
While the header says C/H/S the actual numbers where printed as
C/S/H.

Addresses: http://bugs.debian.org/815847
Reported-by: "groups, freeman" <freeman_groups@reason.dyndns.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
libfdisk/src/dos.c

index 2f3a37bcba3e97ce158ad615fe1de7ec1536fbd6..b1992258b5a7f2cccc574ec8c9e0ade4b31d3a73 100644 (file)
@@ -1903,15 +1903,15 @@ static int dos_get_partition(struct fdisk_context *cxt, size_t n,
        /* start C/H/S */
        if (asprintf(&pa->start_chs, "%d/%d/%d",
                                cylinder(p->bs, p->bc),
-                               sector(p->bs),
-                               p->bh) < 0)
+                               p->bh,
+                               sector(p->bs)) < 0)
                return -ENOMEM;
 
        /* end C/H/S */
        if (asprintf(&pa->end_chs, "%d/%d/%d",
                                cylinder(p->es, p->ec),
-                               sector(p->es),
-                               p->eh) < 0)
+                               p->eh,
+                               sector(p->es)) < 0)
                return -ENOMEM;
 
        return 0;