tar: don't call digest finalization twice

otherwise bad things happens. avoid this be checking end of
stream at the beginning of read.
cute-signatures
Timo Teras 2009-07-29 19:06:10 +03:00
parent 0d9810ea6a
commit 8cacc96bf0
1 changed files with 3 additions and 0 deletions

View File

@ -90,6 +90,9 @@ static ssize_t tar_entry_read(void *stream, void *ptr, size_t size)
if (size > teis->bytes_left)
size = teis->bytes_left;
if (size == 0)
return 0;
r = teis->tar_is->read(teis->tar_is, ptr, size);
if (r < 0)
return r;