Fix for SF bug 988120 via patch 1061941.

If read() returned less than the number of bytes request, the full amount was subtracted from length instead of the actually read amount.
2 files changed