Remove bytestring_to_ep_str

Use wmem equivalent bytestring_to_str

Change-Id: I1ec7509e3adb36ab0f65317459653cb3b4b11af8
Reviewed-on: https://code.wireshark.org/review/6368
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-01-07 00:19:55 -05:00
parent 2139110e54
commit 493f03b420
5 changed files with 8 additions and 42 deletions

View File

@ -78,7 +78,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
bytes_to_ep_str@Base 1.12.0~rc1
bytes_to_ep_str_punct@Base 1.12.0~rc1
bytes_to_str@Base 1.99.2
bytestring_to_ep_str@Base 1.12.0~rc1
bytestring_to_str@Base 1.9.1
call_ber_oid_callback@Base 1.9.1
call_dissector@Base 1.9.1

View File

@ -203,11 +203,11 @@ ipx_addr_to_str(const guint32 net, const guint8 *ad)
name = get_ether_name_if_known(ad);
if (name) {
buf = ep_strdup_printf("%s.%s", get_ipxnet_name(net), name);
buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(net), name);
}
else {
buf = ep_strdup_printf("%s.%s", get_ipxnet_name(net),
bytestring_to_ep_str(ad, 6, '\0'));
buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", get_ipxnet_name(net),
bytestring_to_str(wmem_packet_scope(), ad, 6, '\0'));
}
return buf;
}

View File

@ -199,7 +199,9 @@ extern void oid_add_from_encoded(const char* name, const guint8 *oid, gint oid_l
D(3,("\tOid (from encoded): %s %s ",name, oid_subid2string(subids,subids_len)));
add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,subids_len,subids);
} else {
D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len,bytestring_to_ep_str(oid, oid_len, ':')));
gchar* bytestr = (gchar*)bytestring_to_str(NULL, oid, oid_len, ':');
D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len, bytestr));
wmem_free(NULL, bytestr);
}
}
@ -1283,10 +1285,10 @@ char* oid_test_a2b(guint32 num_subids, guint32* subids) {
"oid_string2encoded=[%d]%s \n"
"oid_string2subid=%s \n "
,sub2str
,sub2enc_len,bytestring_to_ep_str(sub2enc, sub2enc_len, ':')
,sub2enc_len,bytestring_to_str(wmem_packet_scope(), sub2enc, sub2enc_len, ':')
,enc2sub ? oid_subid2string(enc2sub,enc2sub_len) : "-"
,enc2str
,str2enc_len,bytestring_to_ep_str(str2enc, str2enc_len, ':')
,str2enc_len,bytestring_to_str(wmem_packet_scope(), str2enc, str2enc_len, ':')
,str2sub ? oid_subid2string(str2sub,str2sub_len) : "-"
);
}

View File

@ -162,38 +162,6 @@ bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct)
* If punct is '\0', no punctuation is applied (and thus
* the resulting string is (len-1) bytes shorter)
*/
const gchar *
bytestring_to_ep_str(const guint8 *ad, const guint32 len, const char punct)
{
gchar *buf;
size_t buflen;
if (!ad)
REPORT_DISSECTOR_BUG("Null pointer passed to bytestring_to_ep_str()");
/* XXX, Old code was using int as iterator... Why len is guint32 anyway?! (darkjames) */
if ( ((int) len) < 0)
return "";
if (!len)
return "";
if (punct)
buflen=len*3;
else
buflen=len*2 + 1;
buf=(gchar *)ep_alloc(buflen);
if (punct)
bytes_to_hexstr_punct(buf, ad, len, punct);
else
bytes_to_hexstr(buf, ad, len);
buf[buflen-1] = '\0';
return buf;
}
const gchar *
bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct)
{

View File

@ -145,9 +145,6 @@ WS_DLL_PUBLIC char *bytes_to_str(wmem_allocator_t *allocator, const guint8 *bd,
*/
WS_DLL_PUBLIC gchar *bytes_to_ep_str_punct(const guint8 *bd, int bd_len, gchar punct);
/* Deprecated, use bytestring_to_str instead */
WS_DLL_PUBLIC const gchar *bytestring_to_ep_str(const guint8 *, const guint32, const char punct);
WS_DLL_PUBLIC const gchar *bytestring_to_str(wmem_allocator_t *scope, const guint8 *ad, const guint32 len, const char punct);
#ifdef __cplusplus