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

Fix many calls to ctype functions #3734

Merged
merged 1 commit into from
May 26, 2023
Merged

Commits on May 25, 2023

  1. Fix many calls to ctype functions

    All ctype functions like `isspace()`, `tolower()` and alike expect a
    character as an `unsigned char` or EOF, anything else has undefined
    behavior.
    
    This commit should fix all calls to the various ctype functions either:
    
    * adding `unsigned char` cast where appropriate;
    * removing useless `int` casts that are more confusing than useful.
    
    Some instances required slightly more involved changes though, but the
    fix itself is the same.
    
    To find the calls to check, I used an equivalent to the following:
    
    ```
    git grep -P 'is(alnum|alpha|cntrl|x?digit|graph|lower|print|punct|'\
    'space|upper|ascii|blank)|to(low|up)er'
    ```
    
    ...and then proceeded to manually check each one of them to see if the
    call, or call chain, was using appropriate values and types.
    b4n committed May 25, 2023
    Configuration menu
    Copy the full SHA
    a76c937 View commit details
    Browse the repository at this point in the history