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

tinystdio: Fix vfprintf to not cap the max precision to print a hex format #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

A-Shehab
Copy link
Collaborator

printing using %.15a or %.15A formats give wrong results because dtox_engine
handles max of 13 figures after decimal point in hex format.
and it carried out that maximum precision to vfprintf function which max out the
number of digits that get printed so if the format given is more than %.13a or
%.13A it will still print 13 digits after the decimal place instead of just adding
zeros after 13 digits which is not the correct behavior for vfprintf.

After this change
vfprintf handles more than 13 figures after the decimal point in hex format.

Issue found by running SuperTest by SolidSands.

A-Shehab added 2 commits July 15, 2024 16:46
…ormat

printing using %.15a or %.15A formats give wrong results because dtox_engine
handles max of 13 figures after decimal point in hex format.
and it carried out that maximum precision to vfprintf function which max out the
number of digits that get printed so if the format given is more than %.13a or
%.13A it will still print 13 digits after the decimal place instead of just adding
zeros after 13 digits which is not the correct behavior for vfprintf.

After this change
vfprintf handles more than 13 figures after the decimal point in hex format.

Signed-off-by: Ahmed Shehab <[email protected]>
issue found by running SuperTest by Solid Sands

Signed-off-by: Ahmed Shehab <[email protected]>
@A-Shehab A-Shehab requested a review from keith-packard as a code owner July 15, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant