diff libfdproto/messages.c @ 792:0f566e550813

improved the previous fix... not sure it was correct
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 12 Jul 2012 22:37:32 +0200
parents 42fa209a8cc4
children c5b7d4a2cc77
line wrap: on
line diff
--- a/libfdproto/messages.c	Thu Jul 12 22:31:20 2012 +0200
+++ b/libfdproto/messages.c	Thu Jul 12 22:37:32 2012 +0200
@@ -1326,8 +1326,7 @@
 /* The location is not on 64b boundary, so we split the writing in two operations to avoid sigbus */
 #define PUT_in_buf_64( _u64data, _bufptr ) {							\
 	uint64_t __v = htonll((uint64_t)(_u64data));						\
-	*(uint32_t *)(_bufptr) = (uint32_t)(__v);						\
-	*(((uint32_t *)(_bufptr))+1) = (uint32_t)(__v >> 32);					\
+	memcpy(_bufptr, &__v, sizeof(__v));							\
 }
 
 /* Write a message header in the buffer */
"Welcome to our mercurial repository"