summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
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/sparc
parent586259d0716ace494e2ee64d7b25fb0089521aec (diff)
correct idiom for snprintf failure handling; ok beck
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/sparc/autoconf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c
index d0c82ab803f..82e83456748 100644
--- a/sys/arch/sparc/sparc/autoconf.c
+++ b/sys/arch/sparc/sparc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.65 2005/04/11 01:50:07 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.66 2005/04/21 00:15:43 deraadt Exp $ */
/* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */
/*
@@ -1912,7 +1912,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);