fix scanf %c conversion wrongly storing a terminating null byte