cat-file: Fix an gcc -Wuninitialized warning

After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks", 21-03-2013) removed a gcc specific hack, older versions of gcc now issue an "'contents' might be used uninitialized" warning. In order to suppress the warning, we simply initialize the variable to NULL in it's declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Mar 26, 2013 at 19:20 UTC 803a777942b0b1c91890c2f97d4f10972cf2881e
1 file changed +1 -1
builtin/cat-file.c
+1 -1
@@ -193,7 +193,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
193 unsigned char sha1[20];
194 enum object_type type = 0;
195 unsigned long size;
196 - void *contents;
196 + void *contents = NULL;
197
198 if (!obj_name)
199 return 1;