diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2005-03-06 01:40:06 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2005-03-06 01:40:06 +0000 |
commit | 7b4abd7b291ef3bc08f89a2f469fdea0f052f977 (patch) | |
tree | 14fabff9433082029a829239a00db088e94a3247 /lib/libc | |
parent | 35c56f9378d0c5ee26c3345124a0dd36deba83c0 (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.c | 4 |
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 |