summaryrefslogtreecommitdiff
path: root/epan/to_str.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-06-01 22:22:46 +0100
committerMichael Mann <mmann78@netscape.net>2016-06-06 22:00:41 +0000
commitf1ff3208a055f462e69c9ac7479271aecf784d79 (patch)
tree51809fa94142090dd57fbd7d006c60d1016da4b2 /epan/to_str.c
parent528edba87ae6a6ffd951bdd137421910ea88d964 (diff)
downloadwireshark-f1ff3208a055f462e69c9ac7479271aecf784d79.tar.gz
Move ip6_to_str_buf() to to_str.c and make it take the buffer length.
Also make it use ws_inet_ntop6() (rather than implementing the string conversion ourselves). Remove ip6_to_str_buf_len(). Change-Id: I1eff3a8941e00987c2ff0c4dcfda13476af86191 Reviewed-on: https://code.wireshark.org/review/15692 Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/to_str.c')
-rw-r--r--epan/to_str.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/to_str.c b/epan/to_str.c
index e70547c0f2..ca4fa907f9 100644
--- a/epan/to_str.c
+++ b/epan/to_str.c
@@ -1033,6 +1033,17 @@ ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len)
*b=0;
}
+void
+ip6_to_str_buf(const struct e_in6_addr *ad, gchar *buf, int buf_len)
+{
+ if (buf_len < WS_INET6_ADDRSTRLEN) {
+ g_strlcpy(buf, BUF_TOO_SMALL_ERR, buf_len); /* Let the unexpected value alert user */
+ return;
+ }
+
+ ws_inet_ntop6(ad, buf, buf_len);
+}
+
gchar *
guid_to_str(wmem_allocator_t *scope, const e_guid_t *guid)
{