diff options
Diffstat (limited to 'epan/dissectors/packet-ositp.c')
-rw-r--r-- | epan/dissectors/packet-ositp.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c index 1c3c7381e0..05a50afb81 100644 --- a/epan/dissectors/packet-ositp.c +++ b/epan/dissectors/packet-ositp.c @@ -373,22 +373,6 @@ static void cotp_frame_end(void) cotp_frame_reset = TRUE; } -static gboolean is_all_printable(const guchar *stringtocheck, int length) -{ - gboolean allprintable; - int i; - - allprintable=TRUE; - for (i=0;i<length;i++) { - if (!g_ascii_isprint(stringtocheck[i])) { - allprintable=FALSE; - break; - } - } - return allprintable; -} /* is_all_printable */ - - static gchar *print_tsap(tvbuff_t *tvb, int offset, int length) { const guchar *tsap = tvb_get_ptr(tvb, offset, length); @@ -401,7 +385,7 @@ static gchar *print_tsap(tvbuff_t *tvb, int offset, int length) if (length <= 0 || length > MAX_TSAP_LEN) g_snprintf(cur, MAX_TSAP_LEN * 2 + 3, "<unsupported TSAP length>"); else { - allprintable = is_all_printable(tsap,length); + allprintable = tvb_ascii_isprint(tvb, offset, length); if (!allprintable) { returned_length = g_snprintf(cur, MAX_TSAP_LEN * 2 + 3, "0x"); idx += MIN(returned_length, MAX_TSAP_LEN * 2 + 3 - 1); @@ -642,7 +626,7 @@ static gboolean ositp_decode_var_part(tvbuff_t *tvb, int offset, int vp_length, * add as bytes and hidden as string; otherwise vice-versa */ if (tsap_display==TSAP_DISPLAY_STRING || (tsap_display==TSAP_DISPLAY_AUTO && - is_all_printable(tvb_get_ptr(tvb, offset,length),length))) { + tvb_ascii_isprint(tvb, offset, length))) { proto_tree_add_string(tree, hf_cotp_vp_src_tsap, tvb, offset, length, print_tsap(tvb, offset, length)); hidden_item = proto_tree_add_item(tree, hf_cotp_vp_src_tsap_bytes, tvb, @@ -665,7 +649,7 @@ static gboolean ositp_decode_var_part(tvbuff_t *tvb, int offset, int vp_length, * add as bytes and hidden as string; otherwise vice-versa */ if (tsap_display==TSAP_DISPLAY_STRING || (tsap_display==TSAP_DISPLAY_AUTO && - is_all_printable(tvb_get_ptr(tvb,offset,length),length))) { + tvb_ascii_isprint(tvb, offset, length))) { proto_tree_add_string(tree, hf_cotp_vp_dst_tsap, tvb, offset, length, print_tsap(tvb, offset, length)); hidden_item = proto_tree_add_item(tree, hf_cotp_vp_dst_tsap_bytes, tvb, |