From 7b316a49b55a2cbe0321e72dce28a92126801d49 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 18 Oct 2011 18:20:35 +0200 Subject: [PATCH] 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 --- compat/inet_ntop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c index ea249c6ac6..9e9f6fbbbc 100644 --- a/compat/inet_ntop.c +++ b/compat/inet_ntop.c @@ -98,7 +98,8 @@ 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; - cur.base = -1; + best.len = 0; + cur = best; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) -- 2.11.4.GIT