Deal with reading a buffer less than what was allocated.

With this fix, file_long_read now passes.