shithub: riscv

Download patch

ref: a2e26ffd4c8d65368503fb36ced68353e3cfdb52
parent: ad14ea30b0571b4b67586a493cc9ef9b78aea2ae
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 */
--