summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
Diffstat (limited to 'missing')
-rw-r--r--missing/inet_ntop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/missing/inet_ntop.c b/missing/inet_ntop.c
index 87ab7bb6..57539dc5 100644
--- a/missing/inet_ntop.c
+++ b/missing/inet_ntop.c
@@ -36,6 +36,10 @@
* SUCH DAMAGE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <tcpdump-stdinc.h>
#include <stdio.h>
@@ -119,7 +123,9 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
for (i = 0; i < IN6ADDRSZ; i++)
words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.len = 0;
best.base = -1;
+ cur.len = 0;
cur.base = -1;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
{
@@ -173,7 +179,7 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
tp += strlen(tp);
break;
}
- tp += sprintf (tp, "%lX", words[i]);
+ tp += sprintf (tp, "%lx", words[i]);
}
/* Was it a trailing run of 0x00's?