bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnulib] Re: nit in strftime.c


From: Paul Eggert
Subject: [bug-gnulib] Re: nit in strftime.c
Date: Fri, 18 Mar 2005 21:41:38 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

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  <address@hidden>

        * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]