From 3277ff9045841a7787622e4ec45cf5c3b138cac3 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Tue, 23 Sep 2008 09:40:45 +0200 Subject: [PATCH] Avoid a division by zero when a value of 0 cylinder is returned. --- src/hdaccess.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hdaccess.c b/src/hdaccess.c index 52823622..f67f466b 100644 --- a/src/hdaccess.c +++ b/src/hdaccess.c @@ -769,6 +769,8 @@ void update_disk_car_fields(disk_t *disk_car) disk_car->geom.cylinders = cylinder_num; } } + if(disk_car->geom.cylinders == 0) + disk_car->geom.cylinders++; disk_car->disk_size=disk_car->disk_real_size; }