summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-03-19 05:33:01 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-03-19 05:33:01 +0000
commit18445fac86ffaf4bf8b41111eee9f8c86f9943c1 (patch)
tree84f4f38cf880a5597e597121b1fcf853ad2e72eb /lib
parentf89674dc6f4e07ef788859f1d1d54137e6dd1fc5 (diff)
downloadcoreutils-18445fac86ffaf4bf8b41111eee9f8c86f9943c1.tar.xz
(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.
Diffstat (limited to 'lib')
-rw-r--r--lib/strftime.c5
1 files 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