Skip to content

Commit

Permalink
Break immediately when inflate exactly reaches the end of the buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet committed Nov 12, 2022
1 parent e99ced2 commit 72eee72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Gzip/Data+Gzip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ extension Data {
stream.next_in = nil
}

} while stream.avail_out == 0
} while stream.avail_out == 0 && status != Z_STREAM_END

guard deflateEnd(&stream) == Z_OK, status == Z_STREAM_END else {
throw GzipError(code: status, msg: stream.msg)
Expand Down

0 comments on commit 72eee72

Please sign in to comment.