mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] print does not support variable width plus padding
@ 2021-12-14 15:22 Andrew Snyder
  2021-12-14 16:03 ` Szabolcs Nagy
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Snyder @ 2021-12-14 15:22 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1262 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-16 11:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 15:22 [musl] print does not support variable width plus padding Andrew Snyder
2021-12-14 16:03 ` Szabolcs Nagy
2021-12-14 16:09   ` Andrew Snyder
2021-12-14 16:10     ` Andrew Snyder
2021-12-14 16:50       ` Rich Felker
2021-12-14 17:05         ` Andrew Snyder
2021-12-15 18:09       ` Quentin Rameau
2021-12-15 18:37         ` Andrew Snyder
2021-12-15 21:21           ` Rich Felker
2021-12-15 21:40             ` enh
2021-12-15 21:51               ` Andrew Snyder
2021-12-16 11:22             ` Ron Yorston

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).