printf: protect against bogus format specifiers. Hopefully closes bug 4184

This commit is contained in:
Denis Vlasenko
2008-07-17 09:17:51 +00:00
parent 416914fc61
commit 0f683f818c
2 changed files with 19 additions and 9 deletions

View File

@@ -24,4 +24,10 @@ testing "printf repeatedly use pattern for each argv" \
"foo\n$HOME\n" \
"" ""
# Why ()s are necessary I have no idea...
testing "printf aborts on bare %" \
"(${bb}printf '%' a b c) 2>&1; echo \$?" \
"printf: invalid directive '%'\n""1\n" \
"" ""
exit $FAILCOUNT