mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-16 18:56:54 +02:00

When a zlib stream has avail_in == 0, it will deflate with a Z_BUF_ERROR to indicate that "no progress is possible". A zbuffer write with an empty string will trigger this condition, and the write call returns/raises an error/exception. The fix is simple: change the do/while to a while loop, so that it only tries to deflate if there is actually data to deflate.