aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mathieson <martin.mathieson@keysight.com>2020-03-21 20:45:45 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2020-03-21 21:28:15 +0000
commit0af8d7c091d5eca352474a71fd0423b3cebbc5d3 (patch)
tree644d86700c88caeb5fb37e5f06989cde218ae624
parent1796abbed660cb1ec370e52d0012d98ceb90c459 (diff)
Some cppcheck fixes.
- UDPCP: fix test for Sync frame detection - Avoid a couple of redundant assignemnts Change-Id: Ib69a3ff4f0e802ddbbbd29eb2a803372c41a7ce4 Reviewed-on: https://code.wireshark.org/review/36526 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c2
-rw-r--r--epan/dissectors/packet-opensafety.c2
-rw-r--r--epan/dissectors/packet-rlc-lte.c2
-rw-r--r--epan/dissectors/packet-rlc-nr.c2
-rwxr-xr-xepan/dissectors/packet-udpcp.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 83bbbcc418..843f700c91 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -1216,7 +1216,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, gint offset,
{
guint8 opcode;
guint8 tag;
- struct pdcp_lte_info *p_pdcp_lte_info = NULL;
+ struct pdcp_lte_info *p_pdcp_lte_info;
tvbuff_t *pdcp_lte_tvb;
guint16 ueid;
guint8 channelId;
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index 76f61c143d..ae1f86d934 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -2482,7 +2482,7 @@ dissect_opensafety_udpdata(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
/* check for openSAFETY frame at beginning of data */
frameFound = findSafetyFrame(message_tvb, 0, global_udp_frame2_first, &frameOffset, &frameLength, NULL );
- if ( ! frameFound || ( frameFound && frameOffset >= 11 ) )
+ if ( ! frameFound || ( frameOffset >= 11 ) )
{
dissector_handle_t udp_transport = find_dissector ( "opensafety_udp_transport" );
if ( udp_transport != NULL )
diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c
index 1556ef129a..ea1d255921 100644
--- a/epan/dissectors/packet-rlc-lte.c
+++ b/epan/dissectors/packet-rlc-lte.c
@@ -2915,7 +2915,7 @@ static void dissect_rlc_lte_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_item *ti;
proto_item *mode_ti;
gint offset = 0;
- struct rlc_lte_info *p_rlc_lte_info = NULL;
+ struct rlc_lte_info *p_rlc_lte_info;
/* Allocate and Zero tap struct */
rlc_lte_tap_info *tap_info = wmem_new0(wmem_packet_scope(), rlc_lte_tap_info);
diff --git a/epan/dissectors/packet-rlc-nr.c b/epan/dissectors/packet-rlc-nr.c
index 8bffdbd5f4..14b6965d37 100644
--- a/epan/dissectors/packet-rlc-nr.c
+++ b/epan/dissectors/packet-rlc-nr.c
@@ -1134,7 +1134,7 @@ static void dissect_rlc_nr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_item *ti;
proto_item *mode_ti;
gint offset = 0;
- struct rlc_nr_info *p_rlc_nr_info = NULL;
+ struct rlc_nr_info *p_rlc_nr_info;
/* Set protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC-NR");
diff --git a/epan/dissectors/packet-udpcp.c b/epan/dissectors/packet-udpcp.c
index 9bf4679b82..899448b4e7 100755
--- a/epan/dissectors/packet-udpcp.c
+++ b/epan/dissectors/packet-udpcp.c
@@ -283,7 +283,7 @@ dissect_udpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
if (msg_type == DATA_FORMAT) {
if (!data_length) {
/* This could just be a sync frame */
- if (!message_id && !0 && !s) {
+ if (!message_id && !n && !s) {
col_append_str(pinfo->cinfo, COL_INFO, " [Sync]");
}
/* Nothing more to show here */