[tstr] need to cast input value for 'toupper' and 'tolower' since they may not receive signed values (EOF is not relevant to us)