Do not pass the NULL terminator to tolower/toupper
Do not pass the NULL terminator to tolower/toupper

The last character within a string is the NULL terminator, which if
passed to tolower/toupper causes valgrind warnings. This change ensures
we only pass actual characters.

gale320/imath,gale320/imath,gale320/imath,gale320/imath,gale320/imath