Fix wrong typecast from int to char without testing EOF

No match.