diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-03-28 06:17:38 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-03-28 06:17:38 +0000 |
commit | 917a3d35b48887b8fd22c84cb90f82da5c35f8f0 (patch) | |
tree | 2e2d897fcd3bfd478e997b04e99fd4c72e91eb3d /sys/arch | |
parent | 9d242002a0eb99a1b6aeafc909419763723fbf79 (diff) |
disk addresses are in hex, not decimal. makes my LSILogic,sas@3/disk@13
correctly match target 19.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/macppc/autoconf.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c index e304cb5089c..9268de605cb 100644 --- a/sys/arch/macppc/macppc/autoconf.c +++ b/sys/arch/macppc/macppc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.23 2007/03/27 07:23:33 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.24 2007/03/28 06:17:37 dlg Exp $ */ /* * Copyright (c) 1996, 1997 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -37,7 +37,7 @@ * from: Utah Hdr: autoconf.c 1.31 91/01/21 * * from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: autoconf.c,v 1.23 2007/03/27 07:23:33 deraadt Exp $ + * $Id: autoconf.c,v 1.24 2007/03/28 06:17:37 dlg Exp $ */ /* @@ -592,13 +592,19 @@ makebootdev(char *bp) int getpno(char **cp) { - int val = 0; + int val = 0, digit; char *cx = *cp; - while(*cx && *cx >= '0' && *cx <= '9') { - val = val * 10 + *cx - '0'; + while (*cx) { + if (*cx >= '0' && *cx <= '9') + digit = *cx - '0'; + else if (*cx >= 'a' && *cx <= 'f') + digit = *cx - 'a' + 0x0a; + else + break; + val = val * 16 + digit; cx++; } *cp = cx; - return val; + return (val); } |