Code

Merge branch 'ss/inet-ntop'
authorJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2011 23:04:35 +0000 (16:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2011 23:04:35 +0000 (16:04 -0700)
* ss/inet-ntop:
  inet_ntop.c: Work around GCC 4.6's detection of uninitialized variables

compat/inet_ntop.c

index ea249c6ac6423fd4ef865c1a9d0149ac0ba0cc46..60b5a1d0f8262baca70247923a399fdb4ee3cac1 100644 (file)
@@ -98,7 +98,9 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
        for (i = 0; i < NS_IN6ADDRSZ; i++)
                words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
        best.base = -1;
+       best.len = 0;
        cur.base = -1;
+       cur.len = 0;
        for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
                if (words[i] == 0) {
                        if (cur.base == -1)