]> code.delx.au - gnu-emacs/blobdiff - lib/strftime.c
Update ps-mode.el from upstream
[gnu-emacs] / lib / strftime.c
index 213ced860dee010bbac8d6c99c9532239104c44a..91d5d85cbcf2a846e99d8af0c93c0353a873f07d 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 occurred 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)                                                                \
     )