From 291ec0f2d2ce65e5ccb876b46d6468af49ddb82e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 5 Jul 2005 17:06:09 -0700 Subject: [PATCH] Don't special-case a zero-sized compression. zlib actually writes a header for that case, and while ignoring that header will get us the right data, it will also end up messing up our stream position. So we actually want zlib to "uncompress" even an empty object. --- unpack-objects.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/unpack-objects.c b/unpack-objects.c index 97d268187..6383db94a 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -55,8 +55,6 @@ static void *get_data(unsigned long size) z_stream stream; void *buf = xmalloc(size); - if (!size) - return buf; memset(&stream, 0, sizeof(stream)); stream.next_out = buf; -- 2.30.2