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

Cast characters to unsigned char before passed to isspace() #103

Closed
wants to merge 2 commits into from

Conversation

gxc
Copy link

@gxc gxc commented Dec 16, 2018

This would avoid sign extension.
Reason: The c argument is an int, the value of which the application
shall ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other value,
the behavior is undefined.
[man7.org] (http://man7.org/linux/man-pages/man3/isspace.3p.html)

Reason: The c argument is an int, the value of which the application
shall ensure is a character representable as an unsigned char or equal
to the value of the macro EOF. If the argument has any other value,
the behavior is undefined.
http://man7.org/linux/man-pages/man3/isspace.3p.html
@dofuuz
Copy link
Contributor

dofuuz commented Mar 4, 2021

This fix is required to use non-ASCII charsets (ex. UTF-8)

@hramrach
Copy link
Contributor

hramrach commented Feb 6, 2024

Can you add a test case?

lmoellendorf added a commit that referenced this pull request Mar 2, 2024
@lmoellendorf
Copy link
Collaborator

@gxc @dofuuz

Sorry, but I cannot see why this should be required to support non-ASCII charsets.

I cannot reproduce these issues. I added commit ab196cb to Test UTF-8 and dots in keys and the test passed.

For now I will close this pull request.

If this is a Windows issue, please help us to get the test build and run on our Windows runner so we can reproduce it. Then this pull request may be re-considered.

lmoellendorf added a commit that referenced this pull request Mar 3, 2024
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.

4 participants