summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:15:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:15:44 +0000
commiteac56f78004e6fc7e746a743c1159c49c62aac5b (patch)
tree9c1895a326c49091d6884c5f70d1ad4b311c55bc /sys/arch/macppc
parent586259d0716ace494e2ee64d7b25fb0089521aec (diff)
correct idiom for snprintf failure handling; ok beck
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/macppc/autoconf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c
index 20159656193..f6650b37e2f 100644
--- a/sys/arch/macppc/macppc/autoconf.c
+++ b/sys/arch/macppc/macppc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.15 2004/12/25 23:02:24 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.16 2005/04/21 00:15:42 deraadt 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.15 2004/12/25 23:02:24 miod Exp $
+ * $Id: autoconf.c,v 1.16 2005/04/21 00:15:42 deraadt Exp $
*/
/*
@@ -330,7 +330,7 @@ setroot()
len = snprintf(buf, sizeof buf, "%s%d", findblkname(majdev),
unit);
- if (len >= sizeof(buf))
+ if (len == -1 || len >= sizeof(buf))
panic("setroot: device name too long");
bootdv = getdisk(buf, len, part, &rootdev);