-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure the correctness when using formatted output conversion
The implementation of __format() produces incorrect results when using field width and flag characters. For example, consider the following printf calls, where the prepended characters are placed in incorrect positions. printf("%#12x\n", 0xff00cde1) --> "0x ff00cde1\n" printf("%#12o\n", 0x1000c) --> "0 200014\n" printf("%12d\n", -3580) --> "0000000-3580\n" Thus, this commit improves __format() to ensure correctness and to make the results consistent with GCC, and adds a test case to validate the changes.
- Loading branch information
Showing
4 changed files
with
168 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.