X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrftime.c;h=91d5d85cbcf2a846e99d8af0c93c0353a873f07d;hb=533101a268dc5015a140ff4695d8eeb04fbe57b6;hp=213ced860dee010bbac8d6c99c9532239104c44a;hpb=38a9c455b0a6ec223aa39bf4c2368afc690616ef;p=gnulib.git diff --git a/lib/strftime.c b/lib/strftime.c index 213ced860..91d5d85cb 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -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) \ )