Fixed unlikely buffer overrun in InputCharacters (thanks Daniel Collin)