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.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,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 28993 invoked from network); 14 Dec 2021 15:29:49 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 14 Dec 2021 15:29:49 -0000 Received: (qmail 17578 invoked by uid 550); 14 Dec 2021 15:29:47 -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 9947 invoked from network); 14 Dec 2021 15:23:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=J/r9LiHpWDXP/+masY75/0PMV5j2ifainGt/2F6c/4g=; b=dgDc71babLHVSiEoQ/Gb6nBvDN2jTGn6qXCMbA/kYDzRvhnyFcWYuyFwzxsczRYUba PcNJqubVVVvISZpVvWpowYcVDaTa3oKCPbav8lgulwVLdjFBU8YCGYqc6XgnxznokK1t TcpIjxAkzknIRBu92NlckPMuqJxInRvUGR4eb99GX8/q5Z720BdbUkJyosf3mLjJoHb9 UrTUwaTdt23uh25VUvnqjLzZjh6brZuQ3CaPBcvH+MqZt/x7mBwWQk7yt/unTq4p883l MWGF1KYSuzfs7ooEIn9Y6dWAZUeNF3EfebNMd00U5eDSDQRH8iBba2f+ag/dkWe1U6cv y74A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=J/r9LiHpWDXP/+masY75/0PMV5j2ifainGt/2F6c/4g=; b=m4Cxo253Ya0/vRCPUmxKfuAYqbfuyuiY/nfoU2JarBZcJQTy6TZtwTX0QZTvNYeNEQ rhUrOkeEhN2Cq6+iZtotLq3VDr0GIvGV9ZuDiRToPfblwMKdrFJObqoTCYJkkzhqtowd rPsDhT2daivCcam386+FTe9EphpScvscuMd9k1eTuhkhGRvU8g2Nxot1ZcuO//qYwRSY cCc9mewQLGuwSZcy2dXqRmTBe5Q99p2IPOQKDmZruvLaATwQtYghQPXvlqiyY4W4dVSx as1EtlKJs880ooNSssRMbiMnOa04StkgKSmeqCIDYgWSn3gyO+iRprbSbrCs4+5COIl/ kZwg== X-Gm-Message-State: AOAM531kRKTKAUDMRaXrF9EvgkTWPO0hdCpGFXnQq9MaDKa3TtkR9AnI 6FkUj3+ftGUeMeVIbuhLFL7CFjL/amCnTn4fMVZRTEoBpkg= X-Google-Smtp-Source: ABdhPJzrbkQsFUiqlxMHfH6b6v1Hgrv2gxYZKVu+oErouL2QLQDEYagLXDc2cn+pNElWuyxaBdUjrG0fkZGxogZegMA= X-Received: by 2002:a67:e14d:: with SMTP id o13mr5318465vsl.29.1639495372910; Tue, 14 Dec 2021 07:22:52 -0800 (PST) MIME-Version: 1.0 From: Andrew Snyder Date: Tue, 14 Dec 2021 10:22:42 -0500 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="00000000000050332d05d31cc3f6" Subject: [musl] print does not support variable width plus padding --00000000000050332d05d31cc3f6 Content-Type: text/plain; charset="UTF-8" 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 # Correct expected ' 1' docker run -it --rm ubuntu printf %2i 1 # Correct expected ' 1' docker run -it --rm ubuntu printf %*i 2 1 # Correct expected '01' docker run -it --rm ubuntu printf %02i 1 # Correct expected '01' docker run -it --rm ubuntu printf %0*i 2 1 --Andrew --00000000000050332d05d31cc3f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I would like to be cc'd on the replies=C2=A0

Looks like a bug in the musl printf functionality=C2=A0
When using variable width format string and specifying a pa= dding musl fails to format properly.=C2=A0

I am us= ing musl indirectly through an emscripten compile of a native library.

Consider the following=C2=A0repro steps using alpine d= ocker image. Correct results exist when using ubuntu image

# Correct expected=C2=A0 ' 1'
docker run -it --r= m alpine printf %2i 1
# Correct expected=C2=A0 ' 1'
do= cker run -it --rm alpine printf %*i 2 1
# Correct expected=C2=A0 = '01'
docker run -it --rm alpine printf %02i 1
# errors, Expec= ted '01'=C2=A0
docker run -it --rm alpine printf %0*i 2 1
<= div>
# Correct expected=C2=A0 ' 1'
docker run -it --rm ubuntu= printf %2i 1
# Correct expected=C2=A0 ' 1'
docker run= -it --rm ubuntu printf %*i 2 1
# Correct expected=C2=A0 '01&= #39;
docker run -it --rm ubuntu printf %02i 1
# Correct expected=C2= =A0 '01'
docker run -it --rm ubuntu printf %0*i 2 1

--Andrew
--00000000000050332d05d31cc3f6--