check HAVE_MORE flag in got_inflate_to_file()
diff --git a/lib/zb.c b/lib/zb.c
index 0d9155f..fb7d512 100644
--- a/lib/zb.c
+++ b/lib/zb.c
@@ -178,7 +178,7 @@ got_inflate_to_file(size_t *outlen, FILE *infile, FILE *outfile)
}
*outlen += avail;
}
- } while (avail > 0);
+ } while (zb.flags & GOT_ZSTREAM_F_HAVE_MORE);
done:
if (err == NULL)