uri-library icon indicating copy to clipboard operation
uri-library copied to clipboard

Argument of std::isalnum() and friends should be unsigned char

Open ingo-h opened this issue 2 months ago • 0 comments

As noted at https://en.cppreference.com/w/cpp/string/byte/isalnum#Notes:

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.

Use of std::isalnum() and std::isdigit() in uri.hh does not respect this. The arguments should be type-casted to unsigned char.

ingo-h avatar Oct 03 '25 16:10 ingo-h