fix edge cases
commitee4e74dd6a20706f29ef30a2613a1977f6f325fa
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Apr 2008 20:10:18 +0000 (11 16:10 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 11 Apr 2008 20:10:18 +0000 (11 16:10 -0400)
tree85f69d7ee0e579f0d12c50b8036da90623fa4d51
parent0bf88ea14cda6e6e57e97356862628ae49269c8a
fix edge cases

If a file an exact multiple of the max buffer size were sponged, it
would fail at the end due to trying to write 0 remaining bytes from the
buffer to the temp file. A similar bug occurred if sponge's input was
empty. Amazing how such a seemingly simple thing can get so tricky..

Also added check for read error from the temp file, just in case.
sponge.c