From 1d695e8ed4b15acfab9d7ba885cb133c0f91e4ba Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 15 Jun 2009 16:51:07 +0000 Subject: [PATCH] - The maximum number of heads is 255, not 256. Pointed out by: marcel --- lib/libdisk/change.c | 2 +- sbin/fdisk/fdisk.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libdisk/change.c b/lib/libdisk/change.c index 297ac11efa9..9cb2a5cd3df 100644 --- a/lib/libdisk/change.c +++ b/lib/libdisk/change.c @@ -36,7 +36,7 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_cyl >= 65536) sane = 0; - if (disk->bios_hd > 256) + if (disk->bios_hd >= 256) sane = 0; #ifdef PC98 if (disk->bios_sect >= 256) diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 1e121bb6450..604cc7d6be9 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1066,8 +1066,8 @@ process_geometry(CMD *command) warnx("ERROR line %d: number of heads not specified", current_line_number); status = 0; - } else if (dos_heads > 256) { - warnx("ERROR line %d: number of heads must be within (1-256)", + } else if (dos_heads > 255) { + warnx("ERROR line %d: number of heads must be within (1-255)", current_line_number); status = 0; }