Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl_mprintf discrepancy with regular printf #12561

Closed
bagder opened this issue Dec 20, 2023 · 0 comments
Closed

curl_mprintf discrepancy with regular printf #12561

bagder opened this issue Dec 20, 2023 · 0 comments
Assignees

Comments

@bagder
Copy link
Member

bagder commented Dec 20, 2023

I did this

When the curl printf functions get told to output something using "illegal" %-codes, it does not behave as expected.

curl_msnprintf(buf, sizeof(buf), "%2 AA %d %K", 500, 501, 502);

I expected the following

I expected

%2 AA 500 %K

I got

A 501 

curl/libcurl version

curl 8.5.0 and git master

operating system

doesn't matter

@bagder bagder self-assigned this Dec 20, 2023
bagder added a commit that referenced this issue Dec 20, 2023
Verify the #12561 fix and test more printf features
bagder added a commit that referenced this issue Dec 20, 2023
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 correcly when
given unknown %-sequences. Fixing that flaw required a different take on
the problem, which resulted in the new two-arrays model.

Fixes #12561
bagder added a commit that referenced this issue Dec 20, 2023
Verify the #12561 fix and test more printf features
bagder added a commit that referenced this issue Dec 20, 2023
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 correcly when
given unknown %-sequences. Fixing that flaw required a different take on
the problem, which resulted in the new two-arrays model.

Fixes #12561
@bagder bagder linked a pull request Dec 20, 2023 that will close this issue
bagder added a commit that referenced this issue Dec 20, 2023
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.

Fixes #12561
Closes #12563
bagder added a commit that referenced this issue Dec 20, 2023
Verify the #12561 fix and test more printf features
bagder added a commit that referenced this issue Dec 21, 2023
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
@bagder bagder closed this as completed in ef2cf58 Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant