Added proper casting of the argument to toupper()