scanf() returns -1 on early input error.