aboutsummaryrefslogtreecommitdiffstats
path: root/pcapio.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-04-26 22:24:48 +0000
committerGuy Harris <guy@alum.mit.edu>2009-04-26 22:24:48 +0000
commitcaff2f7cd4da9f46118f955b3167978c050338f8 (patch)
treefd45de29abf334d528b98153000c1d19c4b5d8be /pcapio.c
parentb6a18ad0b8f0f3ee64d0699f35bad6192208d6a2 (diff)
Cast both parts of a FILETIME to guint32, as I think DWORD is signed.
svn path=/trunk/; revision=28166
Diffstat (limited to 'pcapio.c')
-rw-r--r--pcapio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pcapio.c b/pcapio.c
index b8ff11a36b..b11dad00ca 100644
--- a/pcapio.c
+++ b/pcapio.c
@@ -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,