summaryrefslogtreecommitdiff
path: root/games/hunt/huntd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:10:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:10:24 +0000
commitbe35d93f938f1839db1c6b73858fa7aa6d4a5b95 (patch)
tree15b7f3ed675e6c78cb937d12e2660538eaf4aa1f /games/hunt/huntd
parent307542a63e9da0a05b94f9eedf070fc38c5dffeb (diff)
vsnprintf careful handling of -1; ok beck
Diffstat (limited to 'games/hunt/huntd')
-rw-r--r--games/hunt/huntd/terminal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/games/hunt/huntd/terminal.c b/games/hunt/huntd/terminal.c
index 1dc69b807ea..aaf5ec7ae1e 100644
--- a/games/hunt/huntd/terminal.c
+++ b/games/hunt/huntd/terminal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: terminal.c,v 1.8 2004/01/16 00:13:19 espie Exp $ */
+/* $OpenBSD: terminal.c,v 1.9 2005/04/21 00:10:23 deraadt Exp $ */
/* $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -138,6 +138,8 @@ outyx(pp, y, x, fmt)
va_start(ap, fmt);
len = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
+ if (len == -1)
+ len = 0;
if (len >= (int)sizeof(buf))
len = sizeof(buf) - 1;
if (y >= 0 && x >= 0)