]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
fprintftime: bring back and reword fwrite comment
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Jan 2013 21:21:48 +0000 (13:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Jan 2013 21:22:11 +0000 (13:22 -0800)
* lib/strftime.c (cpy) [FPRINTFTIME]: Re-add reworded comment.

ChangeLog
lib/strftime.c

index da4a068e231d13c89a378c80afb7b93fc868a753..f036ac11aea0cf2ee90a760804eee154cb859ddb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-01-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       fprintftime: bring back and reword fwrite comment
+       * lib/strftime.c (cpy) [FPRINTFTIME]: Re-add reworded comment.
+
        stdio: remove now-unnecessary stdio.c
        Since stdio.in.h no longer uses inline functions, we no longer
        need to compile the extern versions.
index 213ced860dee010bbac8d6c99c9532239104c44a..c82d585bfa1570b2c4f97e266554d208737f0818 100644 (file)
@@ -208,7 +208,14 @@ extern char *tzname[];
          else if (to_uppcase)                                                 \
            fwrite_uppcase (p, (s), _n);                                       \
          else                                                                 \
-           fwrite (s, _n, 1, p);                                              \
+           {                                                                  \
+             /* Ignore the value of fwrite.  The caller can determine whether \
+                an error occured by inspecting ferror (P).  All known fwrite  \
+                implementations set the stream's error indicator when they    \
+                fail due to ENOMEM etc., even though C11 and POSIX.1-2008 do  \
+                not require this.  */                                         \
+             fwrite (s, _n, 1, p);                                            \
+           }                                                                  \
        }                                                                      \
      while (0)                                                                \
     )