getc now returns -1 on EOF