From 5e06adfaa37c08438317061b9b07e685c9a1b4bc Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 15 Mar 2010 15:43:32 +0100 Subject: [PATCH] Fix possible alignment issue. --- dbus/dbus-sysdeps-win.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index ad6c5d1..ebce8ec 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1894,21 +1894,23 @@ _dbus_get_current_time (long *tv_sec, long *tv_usec) { FILETIME ft; - dbus_uint64_t *time64 = (dbus_uint64_t *) &ft; + dbus_uint64_t time64; GetSystemTimeAsFileTime (&ft); + memcpy (&time64, &ft, sizeof (time64)); + /* Convert from 100s of nanoseconds since 1601-01-01 * to Unix epoch. Yes, this is Y2038 unsafe. */ - *time64 -= DBUS_INT64_CONSTANT (116444736000000000); - *time64 /= 10; + time64 -= DBUS_INT64_CONSTANT (116444736000000000); + time64 /= 10; if (tv_sec) - *tv_sec = *time64 / 1000000; + *tv_sec = time64 / 1000000; if (tv_usec) - *tv_usec = *time64 % 1000000; + *tv_usec = time64 % 1000000; } -- 2.7.4