From eac56f78004e6fc7e746a743c1159c49c62aac5b Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 21 Apr 2005 00:15:44 +0000 Subject: correct idiom for snprintf failure handling; ok beck --- sys/arch/macppc/macppc/autoconf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/arch/macppc') 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); -- cgit v1.2.3