Skip to contentSkip to conversation

libfdisk: Fix order of C/H/S numbers output

PATCH Applied Andreas Henriksson 2 participants 2 messages Feb 25, 2016 – Mar 7, 2016 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdisk: Fix order of C/H/S numbers output

While the header says C/H/S the actual numbers where printed as C/S/H.

Addresses: http://bugs.debian.org/815847

---
 libfdisk/src/dos.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
libfdisk/src/dos.c +4 -4
index 2f3a37b..b199225 100644
@@ -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;
Signature · 1 line
2.7.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Andreas Henriksson
 libfdisk/src/dos.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com