1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

printf: use non-zero indexes

This commit is contained in:
Justin Tracey 2025-04-28 13:21:48 -04:00
parent e92e419a93
commit 27487be267
No known key found for this signature in database
GPG key ID: 62B84F5ABDDDCE54
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",