From 18445fac86ffaf4bf8b41111eee9f8c86f9943c1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 19 Mar 2005 05:33:01 +0000 Subject: (my_strftime): If the underlying strftime returns 0 (which shouldn't happen), generate nothing instead of returning 0 immediately, so that nstrftime (NULL, ...) doesn't return 0. --- lib/strftime.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/strftime.c b/lib/strftime.c index 3be18a2b6..71052daeb 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -780,9 +780,8 @@ my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format, *u++ = format_char; *u = '\0'; len = strftime (ubuf, sizeof ubuf, ufmt, tp); - if (len == 0) - return 0; - cpy (len - 1, ubuf + 1); + if (len != 0) + cpy (len - 1, ubuf + 1); } break; #endif -- cgit v1.2.3-70-g09d2