summaryrefslogtreecommitdiffstats
path: root/lib/libc/time
diff options
context:
space:
mode:
authorcloder <cloder@openbsd.org>2005-03-06 01:40:05 +0000
committercloder <cloder@openbsd.org>2005-03-06 01:40:05 +0000
commite25afde6e82ea59cdf9c7c6d8a601aa1898c21e2 (patch)
tree26f5aa90172a1965c7975ec808bd64354430765c /lib/libc/time
parentClean up the tree from incomplete, unreliable and unsupported IEEE1394 code. (diff)
downloadwireguard-openbsd-e25afde6e82ea59cdf9c7c6d8a601aa1898c21e2.tar.xz
wireguard-openbsd-e25afde6e82ea59cdf9c7c6d8a601aa1898c21e2.zip
Always remember to check snprintf return value for -1.
OK hshoexer, jsg, otto, krw
Diffstat (limited to 'lib/libc/time')
-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