Skip to content

Handle printf format as the last item in the format string #372

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

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

mendell27
Copy link
Contributor

@mendell27 mendell27 commented Jul 31, 2024

The code in l_dump_printf_buffer incorrectly assumes that each printf %format in a format string is followed by at least one character. In the case of printf("%d", 10);, this is not the case, and the code will not print the value.

The fix is to exit only when the format string has been processed and there is no conversion to be done.
Note that most printf formats end with an \n, so this problem doesn't occur.

Copy link
Contributor

@sophimao sophimao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mendell27 mendell27 merged commit 4be1f07 into intel:main Jul 31, 2024
20 checks passed
@mendell27 mendell27 deleted the printf_fix branch July 31, 2024 20:16
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.

2 participants