summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/roken/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/roken/strftime.c')
-rw-r--r--crypto/heimdal/lib/roken/strftime.c8
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;
OpenPOWER on IntegriCloud