diff options
Diffstat (limited to 'epan/dissectors/packet-tipc.c')
-rw-r--r-- | epan/dissectors/packet-tipc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index fb41797d..a556ed6a 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -1099,13 +1099,16 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i /* the bearer instance string is padded with \0 to the next word boundry */ b_inst_strlen = tvb_strsize(tipc_tvb, offset); offset += b_inst_strlen; - if ((padlen = (4-b_inst_strlen%4)) > 0) { + if ((padlen = ((b_inst_strlen%4)?(4-(b_inst_strlen%4)):0)) > 0) { proto_tree_add_bytes_format_value(tipc_tree, hf_tipcv2_padding, tipc_tvb, offset, padlen, NULL, "%d byte%c", padlen, (padlen!=1?'s':0)); offset += padlen; } if ((offset-msg_size) > 0) { + int filler_len; + + filler_len = tvb_reported_length_remaining(tipc_tvb, offset); proto_tree_add_bytes_format_value(tipc_tree, hf_tipcv2_filler_mtu_discovery, tipc_tvb, offset, -1, NULL, - "%d byte%c", tvb_reported_length_remaining(tipc_tvb, offset), (padlen!=1?'s':0)); + "%d byte%c", filler_len, (filler_len!=1?'s':0)); } } break; |