X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrftime.c;h=4ca2ffa4fb828c13bfd97f076ae1c4ef2c47f65e;hb=e29e19dce9e19be76fae92b0955d02c843333093;hp=fff5d38eaeca6ce298e8d1f03431713a17bfb654;hpb=e97e3a48d3a23446cf334e288aa6f138a6f9bae5;p=gnulib.git diff --git a/lib/strftime.c b/lib/strftime.c index fff5d38ea..4ca2ffa4f 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -27,6 +27,7 @@ #else # include # if FPRINTFTIME +# include "ignore-value.h" # include "fprintftime.h" # else # include "strftime.h" @@ -198,12 +199,25 @@ extern char *tzname[]; #if FPRINTFTIME # define cpy(n, s) \ add ((n), \ + do \ + { \ if (to_lowcase) \ fwrite_lowcase (p, (s), _n); \ else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ - fwrite ((s), _n, 1, p)) + { \ + /* We are ignoring the value of fwrite here, in spite of the \ + fact that technically, that may not be valid: the fwrite \ + specification in POSIX 2008 defers to that of fputc, which \ + is intended to be consistent with the one from ISO C, \ + which permits failure due to ENOMEM *without* setting the \ + stream's error indicator. */ \ + ignore_value (fwrite ((s), _n, 1, p)); \ + } \ + } \ + while (0) \ + ) #else # define cpy(n, s) \ add ((n), \