there's many places where we do a read/while != -1