aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tcp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-02-09 08:53:30 -0800
committerMichael Mann <mmann78@netscape.net>2016-02-27 03:43:40 +0000
commit845654d8b7d17831976eb9fc6f2f7140a8e2d84e (patch)
tree5d528443918322e5c9d28f6fb38109323b1d925b /epan/dissectors/packet-tcp.c
parent4d22c44f65bba92fb4922344e48c8b3f538022f6 (diff)
TCP: Use MIDDLE DOT for the flag placeholder.
If you apply tcp.flags.str as a column you end up with a Wall Of Asterisks. Use Unicode MIDDLE DOT as a placeholder instead. Change-Id: I3e2bebd2a951cc516399e965ace6bf87501adc9e Reviewed-on: https://code.wireshark.org/review/13855 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/dissectors/packet-tcp.c')
-rw-r--r--epan/dissectors/packet-tcp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index e3617fbf7d..319a84d14e 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4866,19 +4866,21 @@ tcp_flags_to_str(const struct tcpheader *tcph)
static const char *
tcp_flags_to_str_first_letter(const struct tcpheader *tcph)
{
- char *buf;
+ wmem_strbuf_t *buf = wmem_strbuf_new(wmem_packet_scope(), "");
unsigned i;
const unsigned flags_count = 12;
+ const char first_letters[] = "RRRNCEUAPRSF";
/* upper three bytes are marked as reserved ('R'). */
- buf = wmem_strdup(wmem_packet_scope(), "RRRNCEUAPRSF");
for (i = 0; i < flags_count; i++) {
- if (!((tcph->th_flags >> (flags_count - 1 - i)) & 1)) {
- buf[i] = '*';
+ if (((tcph->th_flags >> (flags_count - 1 - i)) & 1)) {
+ wmem_strbuf_append_c(buf, first_letters[i]);
+ } else {
+ wmem_strbuf_append(buf, UTF8_MIDDLE_DOT);
}
}
- return buf;
+ return wmem_strbuf_finalize(buf);
}
static gboolean
@@ -5833,7 +5835,7 @@ proto_register_tcp(void)
NULL, HFILL }},
{ &hf_tcp_flags_str,
- { "TCP Flags", "tcp.flags.str", FT_STRING, BASE_NONE, NULL, 0x0,
+ { "TCP Flags", "tcp.flags.str", FT_STRING, STR_UNICODE, NULL, 0x0,
NULL, HFILL }},
{ &hf_tcp_window_size_value,