diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-04-26 22:24:48 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-04-26 22:24:48 +0000 |
commit | 9165d8a1d846d3d5bf91c206310605a2d580d257 (patch) | |
tree | fd45de29abf334d528b98153000c1d19c4b5d8be /pcapio.c | |
parent | 2ffbebc93d5361bc8853372e93321b3420f632a8 (diff) |
Cast both parts of a FILETIME to guint32, as I think DWORD is signed.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28166 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'pcapio.c')
-rw-r--r-- | pcapio.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -426,9 +426,13 @@ libpcap_write_interface_statistics_block(FILE *fp, /* * Current time, represented as 100-nanosecond intervals since * January 1, 1601, 00:00:00 UTC. + * + * I think DWORD might be signed, so cast both parts of "now" + * to guint32 so that the sign bit doesn't get treated specially. */ GetSystemTimeAsFileTime(&now); - timestamp = ((guint64)now.dwHighDateTime) << 32 + now.dwLowDateTime; + timestamp = ((guint64)(guint32)now.dwHighDateTime) << 32 + + (guint32)now.dwLowDateTime; /* * Convert to same thing but as 1-microsecond, i.e. 1000-nanosecond, |