diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2024-01-19 11:13:39 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2024-01-19 11:13:39 +0100 |
commit | d13d9220bf47f7e91b02c5c8e214780bda840606 (patch) | |
tree | 48411580712005c8d7512807cc2e2de4408cf1c4 /newlib/libc | |
parent | d45261f62a15f8abd94a1031020b9a9f455e4eed (diff) | |
download | newlib-d13d9220bf47f7e91b02c5c8e214780bda840606.zip newlib-d13d9220bf47f7e91b02c5c8e214780bda840606.tar.gz newlib-d13d9220bf47f7e91b02c5c8e214780bda840606.tar.bz2 |
_fputwc_r: actually return result of __fputwc
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>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/stdio/fputwc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c index 8430446..12a6170 100644 --- a/newlib/libc/stdio/fputwc.c +++ b/newlib/libc/stdio/fputwc.c @@ -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; } |