mirror of
https://github.com/curl/curl.git
synced 2026-07-25 21:27:18 +03:00
mprintf: overhaul and bugfixes
In a test case using lots of snprintf() calls using many commonly used %-codes per call, this version is around 30% faster than previous version. It also fixes the #12561 bug which made it not behave correctly when given unknown %-sequences. Fixing that flaw required a different take on the problem, which resulted in the new two-arrays model. lib557: extended - Verify the #12561 fix and test more printf features unit1398: fix test: It used a <num>$ only for one argument, which is not supported. Fixes #12561 Closes #12563
This commit is contained in:
parent
2d4d0c1fd3
commit
ef2cf58c77
3 changed files with 653 additions and 587 deletions
|
|
@ -92,7 +92,7 @@ fail_unless(rc == 15, "return code should be 15");
|
|||
fail_unless(!strcmp(output, " 1234 567"), "wrong output");
|
||||
|
||||
/* double precision */
|
||||
rc = curl_msnprintf(output, 24, "%.*1$.99d", 3, 5678);
|
||||
rc = curl_msnprintf(output, 24, "%2$.*1$.99d", 3, 5678);
|
||||
fail_unless(rc == 0, "return code should be 0");
|
||||
|
||||
UNITTEST_STOP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue