]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix possible alignment issue.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Mon, 15 Mar 2010 14:43:32 +0000 (15:43 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 16 Mar 2010 22:09:48 +0000 (23:09 +0100)
dbus/dbus-sysdeps-win.c

index ad6c5d11587db928ebde74daefe7576073dc2501..ebce8ec6fe2e4dd994ea99e33eee8cb84ac86f0b 100644 (file)
@@ -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;
 }