summaryrefslogtreecommitdiffstats
path: root/missing/inet_ntop.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-01-06 19:03:11 +0000
committerdelphij <delphij@FreeBSD.org>2015-01-06 19:03:11 +0000
commit08263d19579d35a7a65e0c8bcb768504ce76d04e (patch)
treeb0af675e15d65cc0adac2367c37233a794389c9a /missing/inet_ntop.c
parent89918529102669b0d24d8aac9e5516b010b1c81c (diff)
downloadFreeBSD-src-08263d19579d35a7a65e0c8bcb768504ce76d04e.zip
FreeBSD-src-08263d19579d35a7a65e0c8bcb768504ce76d04e.tar.gz
Vendor import of tcpdump 4.6.2.
Diffstat (limited to 'missing/inet_ntop.c')
-rw-r--r--missing/inet_ntop.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/missing/inet_ntop.c b/missing/inet_ntop.c
index d17d592..8c6f7eb 100644
--- a/missing/inet_ntop.c
+++ b/missing/inet_ntop.c
@@ -36,17 +36,13 @@
* SUCH DAMAGE.
*/
-/* $Id: inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $ */
-
-#ifndef lint
-static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $";
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
-#include <errno.h>
/*
*
@@ -126,7 +122,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++)
{
@@ -180,7 +178,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?
@@ -197,7 +195,6 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
return (NULL);
}
return strcpy (dst, tmp);
- return (NULL);
}
#endif /* INET6 */
OpenPOWER on IntegriCloud