aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-01-20 01:34:17 -0800
committerGuy Harris <gharris@sonic.net>2021-01-20 01:34:17 -0800
commit5c719552707749db8ebefd64c4b27428e2b05d20 (patch)
tree907c781d9d85f7dc35c7a91cb8e670cf7a18f702 /epan/dissectors/packet-ncp2222.inc
parent05b9e5377753cb7463294bf17f3f2cc6faec6ba4 (diff)
Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block. Also, they're set before they're used, so don't initialize them when they're declared. This should squelch some unreadVariable warnings from cppcheck.
Diffstat (limited to 'epan/dissectors/packet-ncp2222.inc')
-rw-r--r--epan/dissectors/packet-ncp2222.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 63039e1a82..85ac889b08 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -6804,7 +6804,6 @@ void
nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequence, guint16 type, proto_tree *tree, struct novell_tap *ncp_tap)
{
int i, frag_count=0;
- guint len=0;
guint32 tid = 1;
tvbuff_t *frag_tvb = NULL;
fragment_head *fd_head;
@@ -6898,6 +6897,8 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/* Now we process the fragments */
if (request_value->nds_frag || (request_value->nds_end_frag == pinfo->num))
{
+ guint len;
+
/* Check to see of this is a fragment. If so then mark as a fragment. */
if (frags[frag_count].nds_frag==0xffffffff) {
request_value->nds_frag = FALSE;
@@ -7998,7 +7999,6 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
guint8 completion_code=0;
ptvcursor_t *ptvc = NULL;
const char *error_string;
- guint32 nds_offset = 0;
guint32 nds_error_code = 0;
/*guint32 nds_reply_buffer = 0;*/
const char *nds_error_string = NULL;
@@ -8118,6 +8118,8 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
if (type == NCP_SERVICE_REPLY && ncp_rec && ncp_rec->func==0x68 &&
ncp_rec->subfunc==0x02 && (tvb_reported_length_remaining(tvb, 8) >= 8))
{
+ guint32 nds_offset;
+
nds_offset = 8;
/*nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);*/
nds_offset += 4;
@@ -8312,7 +8314,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
const char* global_object_name = NULL;
guint32 global_eid=0;
gboolean resolve_eid=FALSE;
- guint32 global_flags, nds_prot_flags=0;
+ guint32 global_flags;
guint32 version, value1;
nds_val temp_value;
@@ -8459,6 +8461,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
}
if (nds_frag == 0xffffffff) {
+ guint32 nds_prot_flags;
if (ncp_tree) {
proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, ENC_LITTLE_ENDIAN);