aboutsummaryrefslogtreecommitdiffstats
path: root/epan/value_string.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-05-10 20:52:57 -0400
committerMichael Mann <mmann78@netscape.net>2016-05-11 03:16:59 +0000
commit1d0a97493280fd79d00e85a0971b3842d7f00e5e (patch)
tree8cd3e04aa266b1480774c32692e4ceeab65aefb8 /epan/value_string.c
parent9d08ef3f634c4e26659c6a9dd4c3f1580715aeef (diff)
Simplify val_to_str[_ext] implementation.
All val_to_str API use wmem, so just call the wmem function version passing packet_scope instead of copying it. Change-Id: Ib58b6b702fbaf5a81cc445bd01ef1a523774be6e Reviewed-on: https://code.wireshark.org/review/15348 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/value_string.c')
-rw-r--r--epan/value_string.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/epan/value_string.c b/epan/value_string.c
index 298fd176ed..aac00ba9ec 100644
--- a/epan/value_string.c
+++ b/epan/value_string.c
@@ -38,15 +38,7 @@
const gchar *
val_to_str(const guint32 val, const value_string *vs, const char *fmt)
{
- const gchar *ret;
-
- DISSECTOR_ASSERT(fmt != NULL);
-
- ret = try_val_to_str(val, vs);
- if (ret != NULL)
- return ret;
-
- return wmem_strdup_printf(wmem_packet_scope(), fmt, val);
+ return val_to_str_wmem(wmem_packet_scope(), val, vs, fmt);
}
gchar *
@@ -317,15 +309,7 @@ try_val_to_str_idx_ext(const guint32 val, value_string_ext *vse, gint *idx)
const gchar *
val_to_str_ext(const guint32 val, value_string_ext *vse, const char *fmt)
{
- const gchar *ret;
-
- DISSECTOR_ASSERT(fmt != NULL);
-
- ret = try_val_to_str_ext(val, vse);
- if (ret != NULL)
- return ret;
-
- return wmem_strdup_printf(wmem_packet_scope(), fmt, val);
+ return val_to_str_ext_wmem(wmem_packet_scope(), val, vse, fmt);
}
gchar *