In <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00136.html>
I wrote:
> Come to think of it, perhas the "return 0" below should be an abort()?
On further thought it's probably better just to ignore the bogus
format, so I installed this (in both gnulib and coreutils):
2005-03-18 Paul Eggert <[EMAIL PROTECTED]>
* strftime.c (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.
--- strftime.c 16 Mar 2005 01:01:23 -0000 1.82
+++ strftime.c 19 Mar 2005 05:33:01 -0000 1.83
@@ -780,9 +780,8 @@ my_strftime (CHAR_T *s, size_t maxsize,
*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
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils