Handle null bytes in file input

This also silences an unused return value warning.