aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tds.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-12-13 23:07:23 -0800
committerGuy Harris <gharris@sonic.net>2020-12-13 23:07:23 -0800
commit5bb776bfe3d97c78dd490defacc2498583038391 (patch)
treeb88d7e7283bc3a01edd2f7b52d6cf8470c6109f4 /epan/dissectors/packet-tds.c
parent5a53365f606f3f30bc21e40e233e02893041eb29 (diff)
TDS: make dissect_tds_prelogin_response() return a Boolean.
It either returns 1 or 0, and that's intended as a Boolean; make it return a gboolean and use TRUE and FALSE rather than 1 and 0.
Diffstat (limited to 'epan/dissectors/packet-tds.c')
-rw-r--r--epan/dissectors/packet-tds.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 153974a974..ea3a679369 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -5207,11 +5207,12 @@ netlib_check_login_pkt(tvbuff_t *tvb, guint offset, packet_info *pinfo, guint8 t
return TRUE;
}
-static int
+static gboolean
dissect_tds_prelogin_response(tvbuff_t *tvb, guint offset, proto_tree *tree, tds_conv_info_t *tds_info)
{
guint8 token = 0;
- gint tokenoffset, tokenlen, cur = offset, valid = 0;
+ gint tokenoffset, tokenlen, cur = offset;
+ gboolean valid = FALSE;
/*
* Test for prelogin format compliance
@@ -5228,30 +5229,30 @@ dissect_tds_prelogin_response(tvbuff_t *tvb, guint offset, proto_tree *tree, tds
break;
if(token <= TDS7_PRELOGIN_OPTION_NONCEOPT) {
- valid = 1;
+ valid = TRUE;
}
else {
- valid = 0;
+ valid = FALSE;
break;
}
tokenoffset = tvb_get_ntohs(tvb, cur);
if(tokenoffset > tvb_reported_length_remaining(tvb, 0)) {
- valid = 0;
+ valid = FALSE;
break;
}
cur += 2;
tokenlen = tvb_get_ntohs(tvb, cur);
if(tokenlen > tvb_reported_length_remaining(tvb, 0)) {
- valid = 0;
+ valid = FALSE;
break;
}
cur += 2;
}
if(token != TDS7_PRELOGIN_OPTION_TERMINATOR) {
- valid = 0;
+ valid = FALSE;
}
@@ -6593,7 +6594,7 @@ dissect_tds_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tds_conv_i
(void) memset(&nl_data, '\0', sizeof nl_data);
/* Test for pre-login response in case this response is not a token stream */
- if(dissect_tds_prelogin_response(tvb, pos, tree, tds_info) == 1)
+ if(dissect_tds_prelogin_response(tvb, pos, tree, tds_info) == TRUE)
{
return;
}