summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-03-06 01:40:06 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-03-06 01:40:06 +0000
commit7b4abd7b291ef3bc08f89a2f469fdea0f052f977 (patch)
tree14fabff9433082029a829239a00db088e94a3247 /lib/libc
parent35c56f9378d0c5ee26c3345124a0dd36deba83c0 (diff)
Always remember to check snprintf return value for -1.
OK hshoexer, jsg, otto, krw
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/time/asctime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/time/asctime.c b/lib/libc/time/asctime.c
index 312727c05eb..3004075cf0b 100644
--- a/lib/libc/time/asctime.c
+++ b/lib/libc/time/asctime.c
@@ -5,7 +5,7 @@
#if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID)
static char elsieid[] = "@(#)asctime.c 7.22";
-static char rcsid[] = "$OpenBSD: asctime.c,v 1.10 2005/03/02 12:25:52 millert Exp $";
+static char rcsid[] = "$OpenBSD: asctime.c,v 1.11 2005/03/06 01:40:05 cloder Exp $";
#endif /* LIBC_SCCS and not lint */
/*LINTLIBRARY*/
@@ -85,7 +85,7 @@ int bufsize;
timeptr->tm_mday, timeptr->tm_hour,
timeptr->tm_min, timeptr->tm_sec,
year);
- if (len < bufsize) {
+ if (len != -1 && len < bufsize) {
return buf;
} else {
#ifdef EOVERFLOW