IEEE 802.11: Fix DSCP string handling
Replace looped snprintfs with wmem_strbuf_append_printfs.
This commit is contained in:
parent
39910654d3
commit
85a9e05c52
|
@ -8872,12 +8872,12 @@ static int * const resp_control_fields[] = {
|
|||
};
|
||||
|
||||
static int
|
||||
dissect_dscp_policy_response(tvbuff_t *tvb, packet_info *pinfo _U_,
|
||||
dissect_dscp_policy_response(tvbuff_t *tvb, packet_info *pinfo,
|
||||
proto_tree *tree, int offset)
|
||||
{
|
||||
int start_offset = offset;
|
||||
guint8 count;
|
||||
char status_buf[256];
|
||||
wmem_strbuf_t *status_buf = wmem_strbuf_new_label(pinfo->pool);
|
||||
guint sts_len = 0;
|
||||
int i;
|
||||
|
||||
|
@ -8904,20 +8904,20 @@ dissect_dscp_policy_response(tvbuff_t *tvb, packet_info *pinfo _U_,
|
|||
proto_tree_add_item(status_tree, hf_ieee80211_dscp_policy_id, tvb,
|
||||
offset, 1, ENC_NA);
|
||||
if (sts_len == 0) {
|
||||
sts_len += snprintf(status_buf + sts_len, 256 - sts_len, "%u:", scsid);
|
||||
wmem_strbuf_append_printf(status_buf, "%u:", scsid);
|
||||
} else {
|
||||
sts_len += snprintf(status_buf + sts_len, 256 - sts_len, " %u:", scsid);
|
||||
wmem_strbuf_append_printf(status_buf, " %u:", scsid);
|
||||
}
|
||||
offset += 1;
|
||||
|
||||
status = tvb_get_guint8(tvb, offset);
|
||||
proto_tree_add_item(status_tree, hf_ieee80211_dscp_policy_status, tvb,
|
||||
offset, 1, ENC_NA);
|
||||
sts_len += snprintf(status_buf + sts_len, 256 - sts_len, "%u", status);
|
||||
wmem_strbuf_append_printf(status_buf, "%u", status);
|
||||
offset += 1;
|
||||
}
|
||||
proto_tree_add_string(tree, hf_ieee80211_dscp_policy_scs_sts_list, tvb, 0, 1,
|
||||
status_buf);
|
||||
wmem_strbuf_finalize(status_buf));
|
||||
|
||||
return offset - start_offset;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue