summaryrefslogtreecommitdiff
path: root/lib/libc/time
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-07-03 03:24:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-07-03 03:24:05 +0000
commit75fca2aa3a35362ecff27f0c3041d3f511b51275 (patch)
treed0c647e96313c8d94edf3f50304b78ae1cf249c1 /lib/libc/time
parentaef6c060ee15355c0490999de3c4679d7bb97e84 (diff)
snprintf/vsnprintf return < 0 on error, rather than -1.
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 d2a0d19e94d..ed8de2773b9 100644
--- a/lib/libc/time/asctime.c
+++ b/lib/libc/time/asctime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asctime.c,v 1.23 2015/10/24 18:13:18 guenther Exp $ */
+/* $OpenBSD: asctime.c,v 1.24 2019/07/03 03:24:04 deraadt Exp $ */
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
@@ -99,7 +99,7 @@ asctime3(const struct tm *timeptr, char *buf, int bufsize)
timeptr->tm_mday, timeptr->tm_hour,
timeptr->tm_min, timeptr->tm_sec,
year);
- if (len != -1 && len < bufsize) {
+ if (len >= 0 && len < bufsize) {
return buf;
} else {
errno = EOVERFLOW;