avoid seeking beyond eof