Skip to content

cmExecuteProcessCommand: Cast c to unsigned char before cast to int

Alex requested to merge leha-bot/cmake:fix-isspace-usage-for-signed-char into master

As the 'char' type may be either signed, or unsigned, there are some clashes between C Standard library functions and actual characters while casting it to int directly. In case the 'char' type was signed, the casted to int result value may be extended to full negative digit which may be out of range of isspace() function (e.g. , for MSVC implementation, which checks it for '> -1', and throwing an assertion failure on fail).

Fixes: #25561 (closed)

Merge request reports