From d13d9220bf47f7e91b02c5c8e214780bda840606 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 19 Jan 2024 11:13:39 +0100 Subject: _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 --- newlib/libc/stdio/fputwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib') diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c index 8430446de..12a6170bb 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; } -- cgit v1.2.3