Commit Diff


commit - 824801e7ef276d0d8ca914cf56557ca92153acfc
commit + 6336b73f5e18e9020c14f6eed1b543ab7d098381
blob - fa57ae67369e2d3a5d678d12618c28d6ddd8787d
blob + 361d6bdfa043380b0f148cf09997b15ec71b1eec
--- lib/zb.c
+++ lib/zb.c
@@ -73,6 +73,7 @@ got_inflate_read(struct got_zstream_buf *zb, FILE *f, 
 	z->next_out = zb->outbuf;
 	z->avail_out = zb->outlen;
 
+	*outlenp = 0;
 	if (inlenp)
 		*inlenp = 0;
 	do {
@@ -81,8 +82,7 @@ got_inflate_read(struct got_zstream_buf *zb, FILE *f, 
 			if (n == 0) {
 				if (ferror(f))
 					return got_ferror(f, GOT_ERR_IO);
-				*outlenp = 0;
-				return NULL;
+				break; /* EOF */
 			}
 			z->next_in = zb->inbuf;
 			z->avail_in = n;