Don't hide errors while reading from ZIP files

This commit is contained in:
Hilko Bengen 2020-03-30 15:28:04 +02:00
parent 9b520d0821
commit 344ad9d197
1 changed files with 3 additions and 2 deletions

View File

@ -33,9 +33,10 @@ func (f *File) fillBuffer(offset int64) (err error) {
return return
} }
buf := make([]byte, int(offset)-len(f.buf)) buf := make([]byte, int(offset)-len(f.buf))
n, _ := io.ReadFull(f.reader, buf) if n, readErr := io.ReadFull(f.reader, buf); n > 0 {
if n > 0 {
f.buf = append(f.buf, buf[:n]...) f.buf = append(f.buf, buf[:n]...)
} else if readErr != nil {
err = readErr
} }
return return
} }