]> sourceware.org Git - newlib-cygwin.git/commitdiff
_fputwc_r: actually return result of __fputwc
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 19 Jan 2024 10:13:39 +0000 (11:13 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 19 Jan 2024 10:13:39 +0000 (11:13 +0100)
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>
newlib/libc/stdio/fputwc.c

index 8430446dea403183ec58569166e111f74458c84a..12a6170bbc552b0ed7feba549c8f794be9405550 100644 (file)
@@ -169,7 +169,7 @@ _fputwc_r (struct _reent *ptr,
   wint_t r;
 
   _newlib_flockfile_start (fp);
-  __fputwc(ptr, wc, fp);
+  r = __fputwc(ptr, wc, fp);
   _newlib_flockfile_end (fp);
   return r;
 }
This page took 0.032057 seconds and 5 git commands to generate.