epan: Fix misuse of comma operator

Change-Id: I349dc9896db0bd306bc92f92eb9d4a65d98d309c
Reviewed-on: https://code.wireshark.org/review/23558
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2017-09-15 20:28:24 +02:00
parent 8b11e37f81
commit 3f8384d779
9 changed files with 42 additions and 24 deletions

View File

@ -387,7 +387,7 @@ dissect_tlv_header(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int length
guint8 tlv_type;
guint16 tlv_length;
tlv_marker = tvb_get_guint8(tvb, offset),
tlv_marker = tvb_get_guint8(tvb, offset);
tlv_type = tvb_get_guint8(tvb, offset + 1);
tlv_length = tvb_get_ntohs(tvb, offset + 2);

View File

@ -8057,8 +8057,8 @@ proto_register_gsm_a_bssmap(void)
ett[0] = &ett_bssmap_msg;
ett[1] = &ett_cell_list;
ett[2] = &ett_dlci;
ett[3] = &ett_codec_lst,
ett[4] = &ett_bss_to_bss_info,
ett[3] = &ett_codec_lst;
ett[4] = &ett_bss_to_bss_info;
last_offset = NUM_INDIVIDUAL_ELEMS;

View File

@ -926,27 +926,27 @@ dis_field_scts_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
char sign;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_year, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_month, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_day, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_hour, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_minutes, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(tree, hf_gsm_sms_scts_seconds, tvb, offset, 1, value);
offset++;
@ -1081,15 +1081,15 @@ dis_field_vp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *offse
case 0x03:
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_hour, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_minutes, tvb, offset, 1, value);
offset++;
oct = tvb_get_guint8(tvb, offset);
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4),
value = (oct & 0x0f)*10 + ((oct & 0xf0) >> 4);
proto_tree_add_uint(subtree, hf_gsm_sms_vp_validity_period_seconds, tvb, offset, 1, value);
offset++;
done = TRUE;

View File

@ -1317,7 +1317,8 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
* populate a tree in the second pane with the status of the link layer
* (ie none)
*/
len = 0, encapsulated_protocol = 0;
len = 0;
encapsulated_protocol = 0;
decrypt_dissect_ok = FALSE;
ti = proto_tree_add_item(tree, proto_esp, tvb, 0, -1, ENC_NA);

View File

@ -297,7 +297,7 @@ static int dissect_rpkirtr_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += len_pdu;
proto_tree_add_item(rpkirtr_tree, hf_rpkirtr_length_text, tvb, offset, 4, ENC_BIG_ENDIAN);
len_text = tvb_get_ntohl(tvb, offset);
offset += 4,
offset += 4;
proto_tree_add_item(rpkirtr_tree, hf_rpkirtr_error_text, tvb, offset, len_text, ENC_ASCII|ENC_NA);
offset += len_text;
}

View File

@ -632,10 +632,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
*/
/* Orac[le.+] */
if ( tvb_get_ntohl(tvb, offset+2) == 0x4f726163 )
opi = OPI_VERSION2, skip = 1;
{
opi = OPI_VERSION2;
skip = 1;
}
else if ( tvb_get_ntohl(tvb, offset+3) == 0x4f726163 )
opi = OPI_VERSION2, skip = 2;
{
opi = OPI_VERSION2;
skip = 2;
}
/*
* OPI_OSESSKEY response has a following pattern:
@ -650,10 +656,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
*/
/* ....AUTH (v1) */
else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000000c41555448 )
opi = OPI_OSESSKEY, skip = 1;
{
opi = OPI_OSESSKEY;
skip = 1;
}
/* ..AUTH_V (v2) */
else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0c0c415554485f53 )
opi = OPI_OSESSKEY, skip = 2;
{
opi = OPI_OSESSKEY;
skip = 2;
}
/*
* OPI_OAUTH response has a following pattern:
@ -669,11 +681,16 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo, prot
/* ....AUTH (v1) */
else if ( tvb_get_ntoh64(tvb, offset+3) == 0x0000001341555448 )
opi = OPI_OAUTH, skip = 1;
{
opi = OPI_OAUTH;
skip = 1;
}
/* ..AUTH_V (v2) */
else if ( tvb_get_ntoh64(tvb, offset+3) == 0x1313415554485f56 )
opi = OPI_OAUTH, skip = 2;
{
opi = OPI_OAUTH;
skip = 2;
}
}
if ( opi == OPI_VERSION2 )

View File

@ -127,7 +127,7 @@ static guint get_xot_pdu_len_mult(packet_info *pinfo _U_, tvbuff_t *tvb,
int offset_next = offset + XOT_HEADER_LENGTH + X25_MIN_HEADER_LENGTH;
int tvb_len;
while (tvb_len = tvb_captured_length_remaining(tvb, offset), tvb_len>0){
while ((tvb_len = tvb_captured_length_remaining(tvb, offset)) > 0){
guint16 plen = 0;
int modulo;
guint16 bytes0_1;

View File

@ -662,7 +662,7 @@ prefs_register_protocol_subtree(const char *subtree, int id, void (*apply_cb)(vo
* being the name (if it's later registered explicitly
* with a description, that will override it).
*/
ptr = wmem_strdup(wmem_epan_scope(), ptr),
ptr = wmem_strdup(wmem_epan_scope(), ptr);
new_module = prefs_register_subtree(subtree_module, ptr, ptr, NULL);
}

View File

@ -2364,7 +2364,7 @@ dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
/*Configure Vocoder Parameters*/
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_LITTLE_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN),
proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
param_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Param");