aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-diameter.c
diff options
context:
space:
mode:
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-04 19:35:46 +0000
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-04-04 19:35:46 +0000
commit552d8217d2b62107f47d76e504ea9f8f23f144b1 (patch)
treeb0fc22e8fe4ad35941d9207e7e81bf636488c87e /epan/dissectors/packet-diameter.c
parent108bf33f854b21f1ddbe6ff7b64385591d724d42 (diff)
Fix a warning
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21336 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r--epan/dissectors/packet-diameter.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index a302f04f3b..29f780d59f 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -172,7 +172,7 @@ static ApplicationId *ApplicationIdHead=NULL;
#include "packet-diameter-defs.h"
-#define NTP_TIME_DIFF (2208988800UL)
+#define NTP_TIME_DIFF (2208988800U)
#define TCP_PORT_DIAMETER 3868
#define SCTP_PORT_DIAMETER 3868
@@ -2049,13 +2049,14 @@ static void dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree
case DIAMETER_TIME:
if (avpDataLength == 4) {
+ guint32 ntp_timestamp_secs;
nstime_t data;
struct tm *gmtp;
- data.secs = tvb_get_ntohl(tvb, offset);
+ ntp_timestamp_secs = tvb_get_ntohl(tvb, offset);
/* Present the time as UTC, Time before 00:00:00 UTC, January 1, 1970 can't be presented correctly */
- if ( data.secs >= NTP_TIME_DIFF){
- data.secs -= NTP_TIME_DIFF;
+ if ( ntp_timestamp_secs >= NTP_TIME_DIFF){
+ data.secs = ntp_timestamp_secs - NTP_TIME_DIFF;
data.nsecs = 0;
gmtp = gmtime(&data.secs);