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

examples/sslbackend: fix -Wchar-subscripts warning #4503

Closed

Conversation

MarcelRaad
Copy link
Member

With the isdigit implementation that comes with MSYS2, the argument
is used as an array subscript, resulting in a -Wchar-subscripts
warning. isdigit's behavior is undefined if the argument is negative
and not EOF [0]. As done in lib/curl_ctype.h, cast the char variable
to unsigned char to avoid that.

[0] https://en.cppreference.com/w/c/string/byte/isdigit

With the `isdigit` implementation that comes with MSYS2, the argument
is used as an array subscript, resulting in a -Wchar-subscripts
warning. `isdigit`'s behavior is undefined if the argument is negative
and not EOF [0]. As done in lib/curl_ctype.h, cast the `char` variable
to `unsigned char` to avoid that.

[0] https://en.cppreference.com/w/c/string/byte/isdigit

Closes
@MarcelRaad MarcelRaad deleted the sslbackend_wcharsubscripts branch October 18, 2019 11:06
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants