Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix calls to isalnum() and isalpha() to prevent negative inputs. (#38)
See https://en.cppreference.com/w/cpp/string/byte/isalnum: > Like all other functions from <cctype>, the behavior of > std::isalnum is undefined if the argument's value is neither > representable as unsigned char nor equal to EOF. To use these > functions safely with plain chars (or signed chars), the argument > should first be converted to unsigned char This issue was found by the Visual C++ Static Analyzer (/analyze): toml\toml.h(805) : warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isalnum'. toml\toml.h(821) : warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isalpha'. toml\toml.h(824) : warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isalpha'. toml\toml.h(1304) : warning C6330: 'char' passed as _Param_(1) when 'unsigned char' is required in call to 'isalnum'.
- Loading branch information