]> granicus.if.org Git - curl/commit
mprintf: Fix processing of width and prec args
authorJay Satiro <raysatiro@yahoo.com>
Wed, 9 Mar 2016 07:59:05 +0000 (02:59 -0500)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 12 May 2016 22:06:50 +0000 (00:06 +0200)
commit68701e51c1f794df59d9f70bcddbf714ee91b868
tree5e76101c1e372d42fab764fdbf0b3d8a503baae6
parent117a0ffe9fbe2984d2f964a844a8e662586ae9b1
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
lib/mprintf.c
tests/data/test557
tests/libtest/lib557.c