make fgetc() sane