diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-21 00:26:48 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-21 00:26:48 +0000 |
commit | f7608f9aa9ef4dd45bc2f177d51dfe7c88d3138d (patch) | |
tree | 99feffbb1388a0ad7c450cba462bfdd59641bb26 /sys/arch/sparc64 | |
parent | 251222e6623b5dd2d92f8dd3d4962ffd32d294ee (diff) |
correct idion for snprintf failure handling; ok cloder
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/ofw_machdep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/ofw_machdep.c b/sys/arch/sparc64/sparc64/ofw_machdep.c index 8c435552464..5263552420b 100644 --- a/sys/arch/sparc64/sparc64/ofw_machdep.c +++ b/sys/arch/sparc64/sparc64/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.11 2004/06/15 05:44:45 brad Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.12 2005/04/21 00:26:47 deraadt Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.16 2001/07/20 00:07:14 eeh Exp $ */ /* @@ -602,6 +602,10 @@ prom_printf(const char *fmt, ...) va_start(ap, fmt); len = vsnprintf(buf, sizeof buf, fmt, ap); + if (len == -1) + len = 0; + else if (len >= sizeof buf) + len = sizeof buf - 1; va_end(ap); OF_write(OF_stdout(), buf, len); |