Deal with reading a buffer less than what was allocated.

With this fix, file_long_read now passes.
Merge pull request #767 from dhylands/fix-short-read

Deal with reading a buffer less than what was allocated.