diff options
author | nectar <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
commit | 69a91bec14ec3ad49d1c8a82c40a796755f9e4a3 (patch) | |
tree | 85ecf91fd00875cec4b93111d3a8ed9eec9cddfe /crypto/heimdal/lib/roken/strftime.c | |
parent | 8db4cdb3da4228a5d93635e43825e2e8a2f66db7 (diff) | |
download | FreeBSD-src-69a91bec14ec3ad49d1c8a82c40a796755f9e4a3.zip FreeBSD-src-69a91bec14ec3ad49d1c8a82c40a796755f9e4a3.tar.gz |
Import of Heimdal Kerberos from KTH repository circa 2002/02/17.
Diffstat (limited to 'crypto/heimdal/lib/roken/strftime.c')
-rw-r--r-- | crypto/heimdal/lib/roken/strftime.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/heimdal/lib/roken/strftime.c b/crypto/heimdal/lib/roken/strftime.c index 6056073..dcd279b 100644 --- a/crypto/heimdal/lib/roken/strftime.c +++ b/crypto/heimdal/lib/roken/strftime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1999 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -35,7 +35,7 @@ #endif #include "roken.h" -RCSID("$Id: strftime.c,v 1.11 2000/07/08 14:22:12 assar Exp $"); +RCSID("$Id: strftime.c,v 1.12 2001/09/04 09:53:51 assar Exp $"); static const char *abb_weekdays[] = { "Sun", @@ -172,7 +172,7 @@ strftime (char *buf, size_t maxsize, const char *format, const struct tm *tm) { size_t n = 0; - size_t ret; + int ret; while (*format != '\0' && n < maxsize) { if (*format == '%') { @@ -381,7 +381,7 @@ strftime (char *buf, size_t maxsize, const char *format, "%%%c", *format); break; } - if (ret >= maxsize - n) + if (ret < 0 || ret >= maxsize - n) return 0; n += ret; buf += ret; |