From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C76743858006; Fri, 19 Jan 2024 10:52:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C76743858006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705661525; bh=hP9CP8khBtIrqTG8Uwcp0wg5Ypi2kHeXdZ0v45EKPEE=; h=From:To:Subject:Date:From; b=p46iyF1X+XC45OIOGiMYLnKMu4fKHAVEK6uuY7GmxmNBPlx+46OMPYt8+Y83HDo9j VtOxmaMtoqLPc876uDetsmZG5LhOCJ6B0dTcwmu3UFgV/uFAn+YDwY+sxFHF1oYcGc 1a2NOoSPq+Bpb0NMIk3z3j3A5rgBgcVJXOOu2XYM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] _fputwc_r: actually return result of __fputwc X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: d45261f62a15f8abd94a1031020b9a9f455e4eed X-Git-Newrev: d13d9220bf47f7e91b02c5c8e214780bda840606 Message-Id: <20240119105205.C76743858006@sourceware.org> Date: Fri, 19 Jan 2024 10:52:05 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dd13d9220bf4= 7f7e91b02c5c8e214780bda840606 commit d13d9220bf47f7e91b02c5c8e214780bda840606 Author: Corinna Vinschen AuthorDate: Fri Jan 19 11:13:39 2024 +0100 Commit: Corinna Vinschen CommitDate: Fri Jan 19 11:13:39 2024 +0100 _fputwc_r: actually return result of __fputwc =20 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. =20 Fixes: 09119463a1445 ("stdio: split byte- and wide-char-oriented low-le= vel output functions" Signed-off-by: Corinna Vinschen Diff: --- newlib/libc/stdio/fputwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c index 8430446dea40..12a6170bbc55 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; =20 _newlib_flockfile_start (fp); - __fputwc(ptr, wc, fp); + r =3D __fputwc(ptr, wc, fp); _newlib_flockfile_end (fp); return r; }