Commit af263665002a6f41d4f72e72df339e635890346a

Stefan Sperling 2018-02-11T16:42:30

check HAVE_MORE flag in got_inflate_to_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
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)