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

libc/puts: newline was omitted for empty string #15000

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liamHowatt
Copy link
Contributor

@liamHowatt liamHowatt commented Nov 30, 2024

puts(""); did not print a newline. The standard
behavior is to print a newline even if the string
is empty.

Note: Please adhere to Contributing Guidelines.

Summary

From man 3 puts on Linux:

puts() writes the string s and a trailing newline to stdout.

Impact

Tests that have puts("") may fail if they compare stdout against an expected result.

Testing

sim:nsh

puts("");

Should print a newline to stdout. Currently, nothing is printed.

Edit: Only an issue for the CONFIG_FILE_STREAM implementation. When disabled, a newline is included correctly.

`puts("");` did not print a newline. The standard
behavior is to print a newline even if the string
is empty.

Signed-off-by: liamHowatt <[email protected]>
@github-actions github-actions bot added Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small labels Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant