Skip to content

Commit 7b316a4

Browse files
committed
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 <[email protected]>
1 parent e59f161 commit 7b316a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compat/inet_ntop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
9898
for (i = 0; i < NS_IN6ADDRSZ; i++)
9999
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
100100
best.base = -1;
101-
cur.base = -1;
101+
best.len = 0;
102+
cur = best;
102103
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
103104
if (words[i] == 0) {
104105
if (cur.base == -1)

0 commit comments

Comments
 (0)