summaryrefslogtreecommitdiff
path: root/compat/inet_ntop.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/inet_ntop.c')
-rw-r--r--compat/inet_ntop.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index ea249c6..90b7cc4 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -15,14 +15,8 @@
* SOFTWARE.
*/
-#include <errno.h>
-#include <sys/types.h>
-
#include "../git-compat-util.h"
-#include <stdio.h>
-#include <string.h>
-
#ifndef NS_INADDRSZ
#define NS_INADDRSZ 4
#endif
@@ -98,7 +92,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)