From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dmta1012.nifty.com (mta-snd01003.nifty.com [106.153.227.35]) by sourceware.org (Postfix) with ESMTPS id 4AFF23858C00 for ; Thu, 28 Sep 2023 03:58:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AFF23858C00 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 by dmta1012.nifty.com with ESMTP id <20230928035826051.YBHU.65725.HP-Z230@nifty.com> for ; Thu, 28 Sep 2023 12:58:26 +0900 Date: Thu, 28 Sep 2023 12:58:27 +0900 From: Takashi Yano To: newlib@sourceware.org Subject: Re: fprintf() crashes on wide-oriented stream. Message-Id: <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> In-Reply-To: <20230926124147.a4dd18b495c6e0347a64fec0@nifty.ne.jp> References: <20230926124147.a4dd18b495c6e0347a64fec0@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 26 Sep 2023 12:41:47 +0900 Takashi Yano wrote: > With this patch, __sfputs_r/__sprint_r is split into two versions, one > is for vfprintf which does not handle wide string, and the other (newly > introduced __sfputws_r/__swprin_r) is for vfwprintf which handles wide > string. Please note that fprintf gets working for wide orient stream > just like BSD libc, which behaves differently from GNU libc. I confirmed musl libc also behaves as BSD libc. In the GNU libc (glibc), fprintf() returns -1 with no errno set if the stream is wide-oriented. -- Takashi Yano