diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-08-31 00:25:19 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-08-31 00:25:19 +0000 |
commit | 2f1f2b08edf6f88be53183d805d3dc3b78dfc165 (patch) | |
tree | e8152b7fe0373c306be9038079308d7e01e73007 /wiretap/radcom.c | |
parent | d6147cd00aea1436fdec69f5e02a1d745f886b14 (diff) | |
download | wireshark-2f1f2b08edf6f88be53183d805d3dc3b78dfc165.tar.gz wireshark-2f1f2b08edf6f88be53183d805d3dc3b78dfc165.tar.bz2 wireshark-2f1f2b08edf6f88be53183d805d3dc3b78dfc165.zip |
Convert the seconds value to the right byte order before using it at
all, not just before the third time you use it....
svn path=/trunk/; revision=613
Diffstat (limited to 'wiretap/radcom.c')
-rw-r--r-- | wiretap/radcom.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/wiretap/radcom.c b/wiretap/radcom.c index c0b9186a59..d7ca1c6352 100644 --- a/wiretap/radcom.c +++ b/wiretap/radcom.c @@ -48,6 +48,7 @@ int radcom_open(wtap *wth, int *err) int bytes_read; char magic[8]; struct frame_date start_date; + guint32 sec; struct tm tm; char byte; char encap_magic[7] = {0x54, 0x43, 0x50, 0x00, 0x42, 0x43, 0x09}; @@ -117,9 +118,10 @@ int radcom_open(wtap *wth, int *err) tm.tm_year = pletohs(&start_date.year)-1900; tm.tm_mon = start_date.month-1; tm.tm_mday = start_date.day; - tm.tm_hour = start_date.sec/3600; - tm.tm_min = (start_date.sec%3600)/60; - tm.tm_sec = pletohl(&start_date.sec)%60; + sec = pletohl(&start_date.sec); + tm.tm_hour = sec/3600; + tm.tm_min = (sec%3600)/60; + tm.tm_sec = sec%60; tm.tm_isdst = -1; wth->capture.radcom->start = mktime(&tm); @@ -202,6 +204,7 @@ static int radcom_read(wtap *wth, int *err) int bytes_read; guint16 length; struct frame_date date; + guint32 sec; int data_offset; struct tm tm; char dce; @@ -250,9 +253,10 @@ static int radcom_read(wtap *wth, int *err) tm.tm_year = pletohs(&date.year)-1900; tm.tm_mon = date.month-1; tm.tm_mday = date.day; - tm.tm_hour = date.sec/3600; - tm.tm_min = (date.sec%3600)/60; - tm.tm_sec = pletohl(&date.sec)%60; + sec = pletohl(&date.sec); + tm.tm_hour = sec/3600; + tm.tm_min = (sec%3600)/60; + tm.tm_sec = sec%60; tm.tm_isdst = -1; wth->phdr.ts.tv_sec = mktime(&tm); wth->phdr.ts.tv_usec = pletohl(&date.usec); |