dir.c: squelch false uninitialized memory warning
authorPat Notz <patnotz@gmail.com>
Thu, 16 Sep 2010 20:53:22 +0000 (14:53 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Sep 2010 18:43:12 +0000 (11:43 -0700)
GCC 4.4.4 on MacOS incorrectly warns about potential use of uninitialized memory.

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
diff --git a/dir.c b/dir.c
index 133f472a1e73786e781c1021eea17e543858937f..d1e5e5e5bfaea81cb46fc3e3f57df31c6ef1eb2a 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -232,7 +232,7 @@ int add_excludes_from_file_to_list(const char *fname,
 {
        struct stat st;
        int fd, i;
-       size_t size;
+       size_t size = 0;
        char *buf, *entry;
 
        fd = open(fname, O_RDONLY);