Fix reading of empty fifolog files. When we don't have anything

to inflate, skip the rest of the fifolog reader code to avoid
hitting the assert about Z_OK a bit further down.

Approved by:	phk
MFC after:	1 week
This commit is contained in:
keramida 2010-07-10 11:40:31 +00:00
parent 443242732c
commit 18ad9f5070

View File

@ -304,8 +304,10 @@ fifolog_reader_process(struct fifolog_reader *fr, off_t from, fifolog_reader_ren
if (i == Z_STREAM_END) {
i = inflateReset(zs);
}
if (i != Z_OK)
if (i != Z_OK) {
fprintf(stderr, "inflate = %d\n", i);
exit (250);
}
assert(i == Z_OK);
if (zs->avail_out != fr->olen) {
q = fr->obuf + (fr->olen - zs->avail_out);