]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
fprintftime: Return -1 on output error.
authorBruno Haible <bruno@clisp.org>
Sat, 1 Nov 2025 07:58:08 +0000 (08:58 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 1 Nov 2025 07:58:08 +0000 (08:58 +0100)
* lib/strftime.c (FPUTC): On failure, return FAILURE, not EOF.
(width_cpy) [FPRINTFTIME]: Write -1 as FAILURE, for consistency.

ChangeLog
lib/strftime.c

index d103d7bc0e0921ddf3653c731de97ae06f28ec58..c02c1c14b95a3a8ff82ffa6f3e00c60b9de62f31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-11-01  Bruno Haible  <bruno@clisp.org>
+
+       fprintftime: Return -1 on output error.
+       * lib/strftime.c (FPUTC): On failure, return FAILURE, not EOF.
+       (width_cpy) [FPRINTFTIME]: Write -1 as FAILURE, for consistency.
+
 2025-10-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        fprintftime: return negative on output error
index f18e8f65cd6ca32d6955a392e712016de4b76b44..41e7c5477ce83be9db63df40f819650ead3e6842 100644 (file)
@@ -234,7 +234,7 @@ typedef sbyte_count_t retval_t;
      { \
        int _r = fputc (Byte, P); \
        if (_r < 0) \
-         return _r; \
+         return FAILURE; \
      } \
    while (false)
 
@@ -308,7 +308,7 @@ typedef sbyte_count_t retval_t;
            for (byte_count_t _i = 0; _i < _n; _i++)                           \
              FPUTC (TOUPPER ((UCHAR_T) _s[_i], loc), p);                      \
          else if (fwrite (_s, _n, 1, p) == 0)                                 \
-           return -1;                                                         \
+           return FAILURE;                                                    \
        }                                                                      \
      while (0)                                                                \
     )