aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cp2179.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-04-09 23:06:47 -0700
committerAnders Broman <a.broman58@gmail.com>2018-04-10 14:55:45 +0000
commitc7970d9356a494d847101c2bd92e4ca97a7d3d58 (patch)
treee894b469ecc2c26563fbce3a9512af9bad66c594 /epan/dissectors/packet-cp2179.c
parent2cb93e2121eea20c1e443558d7175f1cab8e1f70 (diff)
Add, and use, "fetch signed value" for lengths < 40 bits.
Add 8-bit, 16-bit, 24-bit, and 32-bit "fetch signed value" routines, and use them rather than casting the result of the 8/16/24/32-bit "fetch unsigned value" routines to a signed type (which, BTW, isn't sufficient for 24-bit values, so this appears to fix a bug in epan/dissectors/packet-zbee-zcl.c). Use numbers rather than sizeof()s in various tvb_get_ routines. Change-Id: I0e48a57fac9f70fe42de815c3fa915f1592548bd Reviewed-on: https://code.wireshark.org/review/26844 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-cp2179.c')
-rw-r--r--epan/dissectors/packet-cp2179.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-cp2179.c b/epan/dissectors/packet-cp2179.c
index 5c4c717636..f5ecddc608 100644
--- a/epan/dissectors/packet-cp2179.c
+++ b/epan/dissectors/packet-cp2179.c
@@ -604,7 +604,7 @@ dissect_bs_response_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, i
/*Report the values of the requested SCAN inclusive data. To figure out which sequence ID the values in the response associated with,
we read the bs_request_frame information and show the corresponding sequence ID of the data in response frame.*/
do{
- analogtestvalue = (gint16)tvb_get_letohs(tvb, offset);
+ analogtestvalue = tvb_get_letohis(tvb, offset);
proto_tree_add_uint_format(cp2179_data_tree, hf_cp2179_analog_16bit, tvb, offset, 2, request_data->requested_points[point_num],
"Analog (16 bit) %u : %i", request_data->requested_points[point_num], analogtestvalue);
point_num += 1;
@@ -638,7 +638,7 @@ dissect_bs_response_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, i
case ANALOG_16_BIT:
do{
- analogtestvalue =(gint16)tvb_get_letohs(tvb, offset);
+ analogtestvalue = tvb_get_letohis(tvb, offset);
proto_tree_add_uint_format(cp2179_data_tree, hf_cp2179_analog_16bit, tvb, offset, 2, analog16_num,
"Analog (16 bit) %u : %i", analog16_num, analogtestvalue);
analog16_num += 1;