Y
Hacker News
new
|
ask
|
show
|
jobs
by
slavik81
2621 days ago
You need to be careful with C's tolower. It takes a signed integer, and negative values are undefined behaviour. It would be safer to cast to unsigned char before calling tolower.
https://en.cppreference.com/w/cpp/string/byte/tolower