printf: pad unsigned numbers properly#5955
Merged
tertsdiepraam merged 3 commits intouutils:mainfrom Feb 10, 2024
Merged
Conversation
4a48d27 to
8bb81d9
Compare
Contributor
|
While playing around I noticed two additional cases where GNU |
Collaborator
Author
|
I think that's just one case right? The second case just parses the zero and then exits. The difference in spacing comes from how the error message is printed. Good catch, though. I'll try to get that edge case in. |
8bb81d9 to
8904e50
Compare
Collaborator
Author
|
Ah hold on actually. |
printf: pad octal numbers with zeros on the leftprintf: pad unsigned numbers properly
a13e4a8 to
8e7ee3f
Compare
cakebaker
approved these changes
Feb 8, 2024
dd6aedf to
337bfee
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #5794 (comment)
Expected (and this PR):
Current main branch:
Note: this PR has expanded in scope a bit. It turned out that the padding logic was faulty for unsigned numbers, so I fixed that, which fixes the problem with
0as well.