From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10484 invoked from network); 12 Jun 2023 23:09:43 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 12 Jun 2023 23:09:43 -0000 Received: (qmail 7383 invoked by uid 550); 12 Jun 2023 23:09:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7351 invoked from network); 12 Jun 2023 23:09:39 -0000 ARC-Seal: i=1; a=rsa-sha256; t=1686611367; cv=none; d=strato.com; s=strato-dkim-0002; b=ogS9aKSHUbFTrS5zLT+j2KaDP/VU8kX6tC8bTtKQ3HVhsC9dYN0wd1OWECPmzHgm3M jSuwzpRDBNoANgS6W6EAuUuHGes3Jp0qpCvyf5/2EUgrmDEA1joiUgA6iwiE72+aiyG+ iWsVc7/l9t2ViWMEy371bBOH+BNaLfxXO9fJPJfFaY7h/EHgPCoDTjtcZDWKY3/MStl3 GOGSHP9/PLM7dGAoi06nX1TUFD/T8FLipFK/bjh+kP6S5JU3JPPMA9mSMJNbzdtwpr3Z VnBl+M4j/SF8Joy8OVLAS1QhKTlS7o5q4dCZhH+qD+Np8JbKxYTAhi89YWeKBw6adVsF TGEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1686611367; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=UXOSi4boL3Tt08v8Yz2iznCPK461g2nIzzOZ2fO7d5Y=; b=Al74qXhOh+We5Pl+5URZDCErk/swguQ8pFEedo4BUZ7xw7S+1iSoEk6dxmpBJTUhZm 1SnZB3c6f3OouI1QuAc9ipAj+aKmqvKpNUSmgQTFikJSRmbVJ0mNGk5sNI15LUxyFFQp 4TnL7HoH+K4PNBp3Pm1W2Md7TRhM8LxgCMq9x4TnmLAkHqzB495NUAeveSGFlX3py9/I J1XeSqyJWhjS/TtdhtenQ3Y2XVjE46UrXvC0AFyvF5CsqA5WSYNtGsLa3j8YnhQa7wj1 Xo3fOww6inaDNxs4OCEZ09UQjDPmzjWWN6VC3i+aKDg4P6/+7fKi1MxX1DEYoFJykO/j JwcA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1686611367; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=UXOSi4boL3Tt08v8Yz2iznCPK461g2nIzzOZ2fO7d5Y=; b=eo5NWwceg6y27mI+PLrZZLou4ZUkZT/+jJ4aLR3xXJrMGui9/RyQK6cVGqAwBQw1U6 wufW8CkdCw9/mNBpOZTwlM2AVAi6hk2bUFgV1kcxwMLMoNYmjJGdsWzlk3Edo67Xtn6w w8Y2VKeeZcMgA9MGLVlC363JGK7hS8QNA0it2KTcxykZ9s3d7uIBf1reQsNtWPA++CO3 N2XwIjHqP8lLbpgqVEavSZ9opgg/gqBJImqoXZoc/MkD7Zavwf8W3GehOcRCN8jsWiMb djfDVdK7U0soeum+77rWLmDoMLC5vzRhaDooOYKZsabTzqdD9mVENn98Y5k0/XaJ+h71 Z32w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1686611367; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=UXOSi4boL3Tt08v8Yz2iznCPK461g2nIzzOZ2fO7d5Y=; b=jR9nXtgraeAFTSH7VMAqMgy4xrWicBuJI6ToHVhTErGsXR1++5p4w9Ne37BwhTUkhw +tOetk/4GpHlKUMF5zAw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOS3KZs85Lks9CMF3B8xzOQr/LjgA==" From: Bruno Haible To: Rich Felker Cc: musl@lists.openwall.com Date: Tue, 13 Jun 2023 01:09:26 +0200 Message-ID: <2776403.6YUMPnJmAY@nimes> In-Reply-To: <20230612211336.GD4163@brightrain.aerifal.cx> References: <16376867.hlxOUv9cDv@nimes> <20230612210159.GC4163@brightrain.aerifal.cx> <20230612211336.GD4163@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [musl] swprintf cannot handle the character 0xff Rich Felker wrote: > However, for wide printf: > > c > If no l (ell) qualifier is present, the int argument shall be > converted to a wide character as if by calling the btowc() > function and the resulting wide character shall be written. > > There's no specification of what happens if btowc fails here, but > passing EOF to btowc is required to fail and return WEOF. Possibly. But in the test program that I provided, I pass 255, not -1 (= EOF). It's well-known that the preferred way to convert a 'char' to 'int' is not by direct assigment/cast, but by casting to 'unsigned char'. That's well-known from [f]getc(), the functions, etc. You don't need to particularly care about programmers who pass '\xff' to a function that expects an 'int'. Bruno