diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-07-03 03:24:05 +0000 |
commit | 75fca2aa3a35362ecff27f0c3041d3f511b51275 (patch) | |
tree | d0c647e96313c8d94edf3f50304b78ae1cf249c1 /lib/libc/time | |
parent | aef6c060ee15355c0490999de3c4679d7bb97e84 (diff) |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'lib/libc/time')
-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 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; |