summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-19 16:13:45 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-19 16:13:45 +0000
commita5fe3cd1ef9606041512d85afa678dcc7690e503 (patch)
tree5b4d3f570ca280c27562f72fff93836cdbd7d9e7
parent39de54410bf4abf3081c1653f48f942cd7273fd1 (diff)
handle snprintf() returning -1. ok henning@
-rw-r--r--usr.sbin/dhcrelay/errwarn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/dhcrelay/errwarn.c b/usr.sbin/dhcrelay/errwarn.c
index 85658ef2435..97b146d2cb5 100644
--- a/usr.sbin/dhcrelay/errwarn.c
+++ b/usr.sbin/dhcrelay/errwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errwarn.c,v 1.3 2005/04/11 19:59:07 deraadt Exp $ */
+/* $OpenBSD: errwarn.c,v 1.4 2005/04/19 16:13:44 moritz Exp $ */
/* Errors and warnings... */
@@ -181,6 +181,8 @@ do_percentm(char *obuf, size_t size, char *ibuf)
++s;
prlen = snprintf(t, fmt_left, "%s",
strerror(saved_errno));
+ if (prlen == -1)
+ prlen = 0;
if (prlen >= fmt_left)
prlen = fmt_left - 1;
t += prlen;