Skip to content

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

Merged
bradh352 merged 2 commits into
c-ares:mainfrom
fffaraz:isascii
Mar 12, 2024
Merged

simple implementation for isascii where stdlib isascii is not available#721
bradh352 merged 2 commits into
c-ares:mainfrom
fffaraz:isascii

Conversation

@fffaraz

@fffaraz fffaraz commented Mar 9, 2024

Copy link
Copy Markdown
Contributor

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

bradh352 commented Mar 11, 2024

Copy link
Copy Markdown
Member

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