1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #7855 from jtracey/printf-nonzero

printf: use non-zero indexes
This commit is contained in:
Dorian Péron 2025-04-30 16:32:31 +02:00 committed by GitHub
commit 279629f67e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 33 deletions

View file

@ -1341,6 +1341,11 @@ fn positional_format_specifiers() {
.succeeds()
.stdout_only("05-");
new_ucmd!()
.args(&["%0$d%d-", "5", "10", "6", "20"])
.fails_with_code(1)
.stderr_only("printf: %0$: invalid conversion specification\n");
new_ucmd!()
.args(&[
"Octal: %6$o, Int: %1$d, Float: %4$f, String: %2$s, Hex: %7$x, Scientific: %5$e, Char: %9$c, Unsigned: %3$u, Integer: %8$i",