aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2005-05-17 19:21:45 +0000
committerAnders Broman <anders.broman@ericsson.com>2005-05-17 19:21:45 +0000
commit4968c6f0860fc74c27e88484d91dc7a7021e51ec (patch)
tree50d94cb68bb54a7e41eb73497204a6d6e48f702a
parent090464f76eb81e40c9e4bea9ef074d3b3aee8265 (diff)
From Yuriy Sidelnikov:
A perfectly good tvb_bytes_to_str() has been used instead of string_to_hex. svn path=/trunk/; revision=14384
-rw-r--r--epan/dissectors/packet-acse.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/epan/dissectors/packet-acse.c b/epan/dissectors/packet-acse.c
index 483b82f45e..66304a322e 100644
--- a/epan/dissectors/packet-acse.c
+++ b/epan/dissectors/packet-acse.c
@@ -233,34 +233,6 @@ call_app_dissector(tvbuff_t *tvb, gint offset, gint param_len,
ENDTRY;
}
}
-static char*
-string_to_hex(const unsigned char * in,char * out,int len)
-{
- char ascii[MAXSTRING];
- int i;
- memset(&ascii,0x00,sizeof(ascii));
-for(i=0;i<len;i++)
- {
- unsigned char o_out = *(in+i);
- sprintf(out+(i<<1),"%.2x",* (in+i));
- if( ( (o_out) >= 'a') & ( (o_out) <='z') ||
- ( (o_out) >= 'A') & ( (o_out) <='Z') ||
- ( (o_out) >= '0') & ( (o_out) <='9')
- )
- {
- ascii[i] = o_out;
- }
- else
- {
- ascii[i] = '.';
- }
-
- }
- strcat(out," ");
- strcat(out,ascii);
- return out;
-}
-
static int read_length(ASN1_SCK *a, proto_tree *tree, int hf_id, guint *len)
{
guint length = 0;
@@ -461,8 +433,8 @@ static void
print_value(proto_tree *acse_tree,tvbuff_t *tvb,int
*offset,int item_len)
{
- char tmp[MAXSTRING];
- string_to_hex(tvb_get_ptr(tvb,*offset,item_len),tmp,item_len);
+ gchar *tmp;
+ tmp = tvb_bytes_to_str(tvb, *offset, item_len);
proto_tree_add_text(acse_tree, tvb, *offset, item_len, tmp);
}
static int