Compiling with -Wall uncovered a bug in _fputwc_r introduced in
commit
09119463a1445 ("stdio: split byte- and wide-char-oriented
low-level output functions"). The underlying function __fputwc
has been accidentally called without fetching its return value.
So the return value of _fputwc_r (and thus fputwc) was undefined.
Fixes: 09119463a1445 ("stdio: split byte- and wide-char-oriented low-level output functions"
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
wint_t r;
_newlib_flockfile_start (fp);
- __fputwc(ptr, wc, fp);
+ r = __fputwc(ptr, wc, fp);
_newlib_flockfile_end (fp);
return r;
}