aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wbxml.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2013-09-12 21:34:58 +0000
committerJörg Mayer <jmayer@loplof.de>2013-09-12 21:34:58 +0000
commit467f128306df3ff058c702b39f3941026f61813f (patch)
treee7b21bb45299d77ba588ed7b3e282d03e8cdd877 /epan/dissectors/packet-wbxml.c
parentfd50ee16e8b595c9bdc2cdc7e7236c75586d6a9a (diff)
emem -> wmem
"tshark -v" tested svn path=/trunk/; revision=51988
Diffstat (limited to 'epan/dissectors/packet-wbxml.c')
-rw-r--r--epan/dissectors/packet-wbxml.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c
index 30e2cd4e59..846f390adf 100644
--- a/epan/dissectors/packet-wbxml.c
+++ b/epan/dissectors/packet-wbxml.c
@@ -52,7 +52,7 @@
#include <epan/packet.h>
#include <epan/prefs.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
/* We need the function tvb_get_guintvar() */
#include "packet-wap.h"
@@ -225,7 +225,7 @@ default_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
guint8 token _U_, guint8 codepage _U_, guint32 *length)
{
guint32 data_len = tvb_get_guintvar(tvb, offset, length);
- char *str = ep_strdup_printf("(%d bytes of opaque data)", data_len);
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
*length += data_len;
return str;
}
@@ -235,7 +235,7 @@ default_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
const char *token _U_, guint8 codepage _U_, guint32 *length)
{
guint32 data_len = tvb_get_guintvar(tvb, offset, length);
- char *str = ep_strdup_printf("(%d bytes of opaque data)", data_len);
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
*length += data_len;
return str;
}
@@ -245,7 +245,7 @@ default_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
guint8 token _U_, guint8 codepage _U_, guint32 *length)
{
guint32 data_len = tvb_get_guintvar(tvb, offset, length);
- char *str = ep_strdup_printf("(%d bytes of opaque data)", data_len);
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
*length += data_len;
return str;
}
@@ -255,7 +255,7 @@ default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
const char *token _U_, guint8 codepage _U_, guint32 *length)
{
guint32 data_len = tvb_get_guintvar(tvb, offset, length);
- char *str = ep_strdup_printf("(%d bytes of opaque data)", data_len);
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of opaque data)", data_len);
*length += data_len;
return str;
}
@@ -269,7 +269,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
switch (data_len) {
case 4: /* YYYY-MM-DD[T00:00:00Z] */
- str = ep_strdup_printf("%%DateTime: "
+ str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
"%02x%02x-%02x-%02xT00:00:00Z",
tvb_get_guint8(tvb, offset),
tvb_get_guint8(tvb, offset + 1),
@@ -277,7 +277,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
tvb_get_guint8(tvb, offset + 3));
break;
case 5: /* YYYY-MM-DDThh[:00:00Z] */
- str = ep_strdup_printf("%%DateTime: "
+ str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
"%02x%02x-%02x-%02xT%02x:00:00Z",
tvb_get_guint8(tvb, offset),
tvb_get_guint8(tvb, offset + 1),
@@ -286,7 +286,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
tvb_get_guint8(tvb, offset + 4));
break;
case 6: /* YYYY-MM-DDThh:mm[:00Z] */
- str = ep_strdup_printf("%%DateTime: "
+ str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
"%02x%02x-%02x-%02xT%02x:%02x:00Z",
tvb_get_guint8(tvb, offset),
tvb_get_guint8(tvb, offset + 1),
@@ -296,7 +296,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
tvb_get_guint8(tvb, offset + 5));
break;
case 7: /* YYYY-MM-DDThh:mm[:00Z] */
- str = ep_strdup_printf("%%DateTime: "
+ str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: "
"%02x%02x-%02x-%02xT%02x:%02x:%02xZ",
tvb_get_guint8(tvb, offset),
tvb_get_guint8(tvb, offset + 1),
@@ -307,7 +307,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
tvb_get_guint8(tvb, offset + 6));
break;
default:
- str = ep_strdup_printf("<Error: invalid binary %%DateTime "
+ str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary %%DateTime "
"(%d bytes of opaque data)>", data_len);
break;
}
@@ -350,11 +350,11 @@ wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
/* octet 6: ZZZZZZZZ */
time_zone = tvb_get_guint8(tvb, offset + 5);
/* Now construct the string */
- str = ep_strdup_printf("WV-CSP DateTime: "
+ str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP DateTime: "
"%04d-%02d-%02dT%02d:%02d:%02d%c",
year, month, day, hour, minute, second, time_zone);
} else { /* Invalid length for a WV-CSP DateTime tag value */
- str = ep_strdup_printf("<Error: invalid binary WV-CSP DateTime value "
+ str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP DateTime value "
"(%d bytes of opaque data)>", data_len);
}
return str;
@@ -369,23 +369,23 @@ wv_integer_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len)
switch (data_len) {
case 1:
- str = ep_strdup_printf("WV-CSP Integer: %d",
+ str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
tvb_get_guint8(tvb, offset));
break;
case 2:
- str = ep_strdup_printf("WV-CSP Integer: %d",
+ str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
tvb_get_ntohs(tvb, offset));
break;
case 3:
- str = ep_strdup_printf("WV-CSP Integer: %d",
+ str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
tvb_get_ntoh24(tvb, offset));
break;
case 4:
- str = ep_strdup_printf("WV-CSP Integer: %d",
+ str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d",
tvb_get_ntohl(tvb, offset));
break;
default:
- str = ep_strdup_printf("<Error: invalid binary WV-CSP Integer value "
+ str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP Integer value "
"(%d bytes of opaque data)>", data_len);
break;
}
@@ -449,7 +449,7 @@ wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
break;
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -485,7 +485,7 @@ wv_csp10_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
return str;
@@ -556,7 +556,7 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
break;
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -593,7 +593,7 @@ wv_csp11_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
return str;
@@ -676,7 +676,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
break;
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -715,7 +715,7 @@ wv_csp12_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
return str;
@@ -852,7 +852,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset,
if (str == NULL)
{ /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -912,7 +912,7 @@ wv_csp13_opaque_literal_tag(tvbuff_t *tvb, guint32 offset,
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
return str;
@@ -931,7 +931,7 @@ sic10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
str = date_time_from_opaque(tvb, offset + *length, data_len);
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -961,7 +961,7 @@ sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
break;
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -980,7 +980,7 @@ emnc10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset,
str = date_time_from_opaque(tvb, offset + *length, data_len);
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -1009,7 +1009,7 @@ emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset,
break;
}
if (str == NULL) { /* Error, or not parsed */
- str = ep_strdup_printf("(%d bytes of unparsed opaque data)", data_len);
+ str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len);
}
*length += data_len;
@@ -1195,7 +1195,7 @@ static value_string_ext vals_wbxml1x_global_tokens_ext = VALUE_STRING_EXT_INIT(v
static char *
ext_t_0_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
{
- char *str = ep_strdup_printf("Variable substitution - escaped: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - escaped: '%s'",
tvb_get_const_stringz(tvb, str_tbl + value, NULL));
return str;
}
@@ -1203,7 +1203,7 @@ ext_t_0_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
static char *
ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
{
- char *str = ep_strdup_printf("Variable substitution - unescaped: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - unescaped: '%s'",
tvb_get_const_stringz(tvb, str_tbl + value, NULL));
return str;
}
@@ -1211,7 +1211,7 @@ ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
static char *
ext_t_2_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl)
{
- char *str = ep_strdup_printf("Variable substitution - no transformation: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - no transformation: '%s'",
tvb_get_const_stringz(tvb, str_tbl + value, NULL));
return str;
}
@@ -5204,7 +5204,7 @@ static value_string_ext vals_wv_csp_11_element_value_tokens_ext = VALUE_STRING_E
static char *
ext_t_0_wv_cspc_11(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
{
- char *str = ep_strdup_printf("Common Value: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
val_to_str_ext(value, &vals_wv_csp_11_element_value_tokens_ext,
"<Unknown WV-CSP 1.1 Common Value token 0x%X>"));
return str;
@@ -5815,7 +5815,7 @@ static const value_string vals_wv_csp_12_element_value_tokens[] = {
static char *
ext_t_0_wv_cspc_12(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
{
- char *str = ep_strdup_printf("Common Value: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
val_to_str(value, vals_wv_csp_12_element_value_tokens,
"<Unknown WV-CSP 1.2 Common Value token 0x%X>"));
return str;
@@ -6656,7 +6656,7 @@ static const value_string vals_wv_csp_13_element_value_tokens[] = {
static char *
ext_t_0_wv_cspc_13(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_)
{
- char *str = ep_strdup_printf("Common Value: '%s'",
+ char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'",
val_to_str(value, vals_wv_csp_13_element_value_tokens,
"<Unknown WV-CSP 1.3 Common Value token 0x%X>"));
return str;
@@ -7072,13 +7072,13 @@ dissect_wbxml_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Compose the summary line */
if ( publicid ) {
- summary = ep_strdup_printf("%s, Public ID: \"%s\"",
+ summary = wmem_strdup_printf(wmem_packet_scope(), "%s, Public ID: \"%s\"",
val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
val_to_str_ext (publicid, &vals_wbxml_public_ids_ext, "(unknown 0x%x)"));
} else {
/* Read length of Public ID from string table */
len = tvb_strsize (tvb, str_tbl + publicid_index);
- summary = ep_strdup_printf("%s, Public ID: \"%s\"",
+ summary = wmem_strdup_printf(wmem_packet_scope(), "%s, Public ID: \"%s\"",
val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"),
tvb_format_text (tvb, str_tbl + publicid_index, len - 1));
}
@@ -7427,7 +7427,7 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
if (map->ext_t[peek & 0x03])
s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl);
else
- s = ep_strdup_printf("EXT_T_%1x (%s)", peek & 0x03,
+ s = wmem_strdup_printf(wmem_packet_scope(), "EXT_T_%1x (%s)", peek & 0x03,
map_token (map->global, 0, peek));
proto_tree_add_text (tree, tvb, off, 1+len,
" %3d | Tag | T %3d "
@@ -7911,7 +7911,7 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
tag_new_known = 0; /* invalidate known tag_new */
} else { /* Known tag */
tag_new_known = peek & 0x3F;
- tag_new_buf=ep_strdup_printf("Tag_0x%02X",
+ tag_new_buf=wmem_strdup_printf(wmem_packet_scope(), "Tag_0x%02X",
tag_new_known);
tag_new_literal = tag_new_buf;
/* Stored looked up tag name string */
@@ -7939,7 +7939,7 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
tag_save_known = 0;
} else { /* Known tag */
tag_save_known = tag_new_known;
- tag_save_buf=ep_strdup_printf("Tag_0x%02X",
+ tag_save_buf=wmem_strdup_printf(wmem_packet_scope(), "Tag_0x%02X",
tag_new_known);
tag_save_literal = tag_save_buf;
/* The last statement avoids needless lookups */
@@ -8226,7 +8226,7 @@ parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb,
if (map->ext_t[peek & 0x03])
s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl);
else
- s = ep_strdup_printf("EXT_T_%1x (%s)", peek & 0x03,
+ s = wmem_strdup_printf(wmem_packet_scope(), "EXT_T_%1x (%s)", peek & 0x03,
map_token (map->global, 0, peek));
proto_tree_add_text (tree, tvb, off, 1+len,