aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rx.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2008-03-16 19:36:09 +0000
committerGuy Harris <guy@alum.mit.edu>2008-03-16 19:36:09 +0000
commit02e090d46ba67b313ba3391380dbf45279d53f25 (patch)
tree6a4380286f0b719fb7bf35746744f8091f8856cc /epan/dissectors/packet-rx.c
parentabb6a98fc9d75b953e5a99e5cb170bde4a5061b5 (diff)
Set rxinfo.epoch from the epoch, and then assign it to ts.secs; that
avoids doing a narrowing case - which, in this case, is safe (rxinfo.epoch is 32 bits, and the value assigned to it is 32 bits, so it's not as if it'd ever be wider than 32 bits even if ts.secs is wider than 32 bits), but you might still have to think about it. svn path=/trunk/; revision=24658
Diffstat (limited to 'epan/dissectors/packet-rx.c')
-rw-r--r--epan/dissectors/packet-rx.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/epan/dissectors/packet-rx.c b/epan/dissectors/packet-rx.c
index c1b3650902..483f88bf90 100644
--- a/epan/dissectors/packet-rx.c
+++ b/epan/dissectors/packet-rx.c
@@ -460,6 +460,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
int offset = 0;
struct rxinfo rxinfo;
guint8 type;
+ nstime_t ts;
guint32 seq, callnumber;
guint16 serviceid;
@@ -482,16 +483,11 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
tree = proto_item_add_subtree(item, ett_rx);
/* epoch : 4 bytes */
- {
- nstime_t ts;
- ts.secs = tvb_get_ntohl(tvb, offset);
- ts.nsecs = 0;
-
- proto_tree_add_time(tree, hf_rx_epoch, tvb,
- offset, 4, &ts);
- rxinfo.epoch = (guint32) ts.secs;
- offset += 4;
- }
+ rxinfo.epoch = tvb_get_ntohl(tvb, offset);
+ ts.secs = rxinfo.epoch;
+ ts.nsecs = 0;
+ proto_tree_add_time(tree, hf_rx_epoch, tvb, offset, 4, &ts);
+ offset += 4;
/* cid : 4 bytes */
rxinfo.cid = tvb_get_ntohl(tvb, offset);