Skip to content

Fix printf %d with float args, add specifier tests#36

Open
kelp wants to merge 1 commit intomainfrom
fix/printf-audit-findings
Open

Fix printf %d with float args, add specifier tests#36
kelp wants to merge 1 commit intomainfrom
fix/printf-audit-findings

Conversation

@kelp
Copy link
Copy Markdown
Owner

@kelp kelp commented Apr 2, 2026

Fix %d with float argument to match GNU behavior. Add 24 integration tests for format specifiers.

parseIntArgEx now tries float parsing (with truncation) before
falling back to partial string parse. This matches GNU behavior:
printf '%d' 3.9 outputs 3, printf '%d' 1e2 outputs 100.

Added 24 integration tests covering %f, %e, %g, %c, %u, %b,
%d-with-float, +/# flags, and .* precision from argument.
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