diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-03-29 13:57:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-03-29 13:57:54 +0000 |
commit | f28cdedd0fae81405c7695840065cb0bfc39f32a (patch) | |
tree | e7cceeb775b461a1ba6afc587f584853fb3e5b4c /sys/arch/i386/stand | |
parent | 6cf92f82961dca77af354874a668b32e0b521427 (diff) |
off-by-one check didn't recognize partition 'a' section on specified
disk, and would fall through to the active partition selection
from crystal kolipe, ok miod krw
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index 0a034f820cc..0361cecb5a5 100644 --- a/sys/arch/i386/stand/libsa/cmd_i386.c +++ b/sys/arch/i386/stand/libsa/cmd_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd_i386.c,v 1.36 2016/06/10 18:36:06 jcs Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.37 2022/03/29 13:57:53 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -119,7 +119,7 @@ Xboot(void) dev += (cmd.argv[1][2] - '0'); part = (cmd.argv[1][3] - 'a'); - if (part > 0) + if (part >= 0) printf("[%x,%d]\n", dev, part); else printf("[%x]\n", dev); @@ -131,7 +131,7 @@ Xboot(void) goto bad; /* Frob boot flag in buffer from HD */ - if ((dev & 0x80) && (part > 0)){ + if ((dev & 0x80) && (part >= 0)) { int i, j; for (i = 0, j = DOSPARTOFF; i < 4; i++, j += 16) |