inet_ntop.c: Work around GCC 4.6's detection of uninitialized variables
GCC 4.6 claims that error: 'best.len' may be used uninitialized in this function so silence that warning which is treated as an error by also initializing the "len" members of the struct. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sebastian Schuberth committed
Oct 18, 2011 at 18:25 UTC
185528a859170a659ae8359d13540211775e3056
1 file changed
+2
compat/inet_ntop.c
+2
@@ -98,7 +98,9 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
98
for (i = 0; i < NS_IN6ADDRSZ; i++)
99
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
100
best.base = -1;
101
+ best.len = 0;
102
cur.base = -1;
103
+ cur.len = 0;
104
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
105
if (words[i] == 0) {
106
if (cur.base == -1)