Kafka: Fix Dead Store
Fix dead store (Dead assignement/Dead increment) Warning found by Clang Change-Id: I3ac2e2b6a1ed7621f65f1a98e8b7b3704e8b299d Reviewed-on: https://code.wireshark.org/review/34481 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
de4efb6af7
commit
3ebf2e2d51
1 changed files with 5 additions and 5 deletions
|
@ -1079,10 +1079,10 @@ dissect_kafka_string_new(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
|
|||
pi = proto_tree_add_item(tree, hf_item, tvb, offset+len, (gint)val, ENC_NA | ENC_UTF_8);
|
||||
} else if (val == 0) {
|
||||
// there is empty payload (0 octets)
|
||||
pi = proto_tree_add_string_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<EMPTY>");
|
||||
proto_tree_add_string_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<EMPTY>");
|
||||
} else if (val == -1) {
|
||||
// there is no payload (null)
|
||||
pi = proto_tree_add_string_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<NULL>");
|
||||
proto_tree_add_string_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<NULL>");
|
||||
val = 0;
|
||||
} else {
|
||||
pi = proto_tree_add_string_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<INVALID>");
|
||||
|
@ -1134,13 +1134,13 @@ dissect_kafka_bytes_new(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
|
|||
val = 0;
|
||||
} else if (val > 0) {
|
||||
// there is payload available, possibly with 0 octets
|
||||
pi = proto_tree_add_item(tree, hf_item, tvb, offset+len, (gint)val, ENC_NA);
|
||||
proto_tree_add_item(tree, hf_item, tvb, offset+len, (gint)val, ENC_NA);
|
||||
} else if (val == 0) {
|
||||
// there is empty payload (0 octets)
|
||||
pi = proto_tree_add_bytes_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<EMPTY>");
|
||||
proto_tree_add_bytes_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<EMPTY>");
|
||||
} else if (val == -1) {
|
||||
// there is no payload (null)
|
||||
pi = proto_tree_add_bytes_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<NULL>");
|
||||
proto_tree_add_bytes_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<NULL>");
|
||||
val = 0;
|
||||
} else {
|
||||
pi = proto_tree_add_bytes_format_value(tree, hf_item, tvb, offset+len, 0, NULL, "<INVALID>");
|
||||
|
|
Loading…
Reference in a new issue