git: 9front

Download patch

ref: 8af2faec19a2e0b4c80032ff03a86e829f45ca81
parent: 9a69aa8a39059deef0f64a68643bc8a100dbfa89
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sat Apr 28 05:34:02 EDT 2012

fdisk: ignore 0 endsecotor for partition geometry discovery

--- a/sys/src/libdisk/disk.c
+++ b/sys/src/libdisk/disk.c
@@ -113,7 +113,7 @@
 		}
 	}
 
-	if(h == -1)
+	if(h < 0 || s <= 0)
 		return -1;
 
 	disk->h = h+1;	/* heads count from 0 */
--