mirror of
https://github.com/darlinghq/darling-zlib.git
synced 2024-11-23 11:59:49 +00:00
Fix bug in gzgets() for a concatenated empty gzip stream.
This commit is contained in:
parent
f32370e542
commit
0a81dc026c
12
gzread.c
12
gzread.c
@ -569,14 +569,14 @@ char * ZEXPORT gzgets(file, buf, len)
|
||||
left = (unsigned)len - 1;
|
||||
if (left) do {
|
||||
/* assure that something is in the output buffer */
|
||||
if (state->have == 0) {
|
||||
while (state->have == 0 && (state->strm.avail_in || !state->eof)) {
|
||||
if (gz_make(state) == -1)
|
||||
return NULL; /* error */
|
||||
if (state->have == 0) { /* end of file */
|
||||
if (buf == str) /* got bupkus */
|
||||
return NULL;
|
||||
break; /* got something -- return it */
|
||||
}
|
||||
}
|
||||
if (state->have == 0) { /* end of file */
|
||||
if (buf == str) /* got bupkus */
|
||||
return NULL;
|
||||
break; /* got something -- return it */
|
||||
}
|
||||
|
||||
/* look for end-of-line in current output buffer */
|
||||
|
Loading…
Reference in New Issue
Block a user