Skip to content

Commit

Permalink
Merge pull request #56 from GetToSet/ethanwong/inflate-stream-end
Browse files Browse the repository at this point in the history
Break immediately when `inflate` exactly reaches the end of the buffer.
  • Loading branch information
1024jp authored Apr 29, 2023
2 parents 83238f0 + 72eee72 commit 0dabd4e
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 0dabd4e

Please sign in to comment.