summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-11 15:16:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-11 15:16:30 +0000
commit37ba20a85c55231c0ae8be159f01c9815dd7dfb9 (patch)
tree12c7411507a1020824756b784e0f8ef2b5c85977 /sbin
parentffb7a773a6090d832bc785080aafc738eb775dc4 (diff)
handle snprintf returning -1; ok henning
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/errwarn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dhclient/errwarn.c b/sbin/dhclient/errwarn.c
index f6925d0cfa2..c37ca4c6d14 100644
--- a/sbin/dhclient/errwarn.c
+++ b/sbin/dhclient/errwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errwarn.c,v 1.8 2005/04/11 15:16:14 deraadt Exp $ */
+/* $OpenBSD: errwarn.c,v 1.9 2005/04/11 15:16:29 deraadt Exp $ */
/* Errors and warnings... */
@@ -186,7 +186,9 @@ do_percentm(char *obuf, size_t size, char *ibuf)
++s;
prlen = snprintf(t, fmt_left, "%s",
strerror(saved_errno));
- if (prlen >= fmt_left)
+ if (prlen == -1)
+ prlen = 0;
+ else if (prlen >= fmt_left)
prlen = fmt_left - 1;
t += prlen;
fmt_left -= prlen;