fixing crash when trying to read a 0-byte file