Skip to content

simple implementation for isascii where stdlib isascii is not available #721

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 2 commits into from
Mar 12, 2024
Merged

simple implementation for isascii where stdlib isascii is not available #721

merged 2 commits into from
Mar 12, 2024

Conversation

fffaraz
Copy link
Contributor

@fffaraz fffaraz commented Mar 9, 2024

Some platforms don't have the isascii() function. I had a similar patch for wolfssl as well.
https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/wolfcrypt/types.h#L934

@bradh352
Copy link
Member

bradh352 commented Mar 11, 2024

I'd rather just always use your definition as its always correct. That said, we should cast c to unsigned char when checked so we don't get warnings and we can omit the check for >= 0 since that's always true when unsigned. If you don't do both of those, depending on where its checked, you might get a warning emitted from the compiler about one condition always being true.

@bradh352 bradh352 merged commit e9e6ae2 into c-ares:main Mar 12, 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.

2 participants