haiku/getroot.c (grub_util_find_partition_start_os): Avoid division by zero.
This commit is contained in:
parent
4e0a25a4c0
commit
ac8bac2496
2 changed files with 6 additions and 1 deletions
|
@ -65,7 +65,7 @@ grub_util_find_partition_start_os (const char *dev)
|
|||
device_geometry geo;
|
||||
if (ioctl (fd, B_GET_GEOMETRY, &geo, sizeof (geo)) < 0)
|
||||
return 0;
|
||||
ret /= geo.bytes_per_sector;
|
||||
ret /= geo.bytes_per_sector ? : 512;
|
||||
close (fd);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue