mprintf: Fix processing of width and prec args

Prior to this change a width arg could be erroneously output, and also
width and precision args could not be used together without crashing.

"%0*d%s", 2, 9, "foo"

Before: "092"
After: "09foo"

"%*.*s", 5, 2, "foo"

Before: crash
After: "   fo"

Test 557 is updated to verify this and more
This commit is contained in:
Jay Satiro 2016-03-09 02:59:05 -05:00 committed by Daniel Stenberg
parent 117a0ffe9f
commit 68701e51c1
3 changed files with 90 additions and 20 deletions

View file

@ -39,6 +39,7 @@ All curl_mprintf() signed int tests OK!
All curl_mprintf() unsigned long tests OK!
All curl_mprintf() signed long tests OK!
All curl_mprintf() curl_off_t tests OK!
All curl_mprintf() strings tests OK!
</stdout>
</verify>