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.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 898 invoked from network); 14 Dec 2021 16:03:42 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 14 Dec 2021 16:03:42 -0000 Received: (qmail 32396 invoked by uid 550); 14 Dec 2021 16:03:39 -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 32363 invoked from network); 14 Dec 2021 16:03:38 -0000 Date: Tue, 14 Dec 2021 17:03:27 +0100 From: Szabolcs Nagy To: Andrew Snyder Cc: musl@lists.openwall.com Message-ID: <20211214160327.GA1494342@port70.net> Mail-Followup-To: Andrew Snyder , musl@lists.openwall.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] print does not support variable width plus padding * Andrew Snyder [2021-12-14 10:22:42 -0500]: > I would like to be cc'd on the replies > > Looks like a bug in the musl printf functionality > > When using variable width format string and specifying a padding musl fails > to format properly. > > I am using musl indirectly through an emscripten compile of a native > library. > > Consider the following repro steps using alpine docker image. Correct > results exist when using ubuntu image > > # Correct expected ' 1' > docker run -it --rm alpine printf %2i 1 > # Correct expected ' 1' > docker run -it --rm alpine printf %*i 2 1 > # Correct expected '01' > docker run -it --rm alpine printf %02i 1 > # errors, Expected '01' > docker run -it --rm alpine printf %0*i 2 1 i get the expected result on alpine $ printf %0*i 2 1 01 what do you get?