From a256932620856c72b3dd3bd53d8aef86c4688abc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 13 Nov 2013 21:51:21 +0000 Subject: [PATCH] -avoid bus error on sparc --- src/util/container_multipeermap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/container_multipeermap.c b/src/util/container_multipeermap.c index 8ec3a2077..f5d3b4ef4 100644 --- a/src/util/container_multipeermap.c +++ b/src/util/container_multipeermap.c @@ -245,8 +245,11 @@ static unsigned int idx_of (const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key) { - GNUNET_assert (map != NULL); - return (*(unsigned int *) key) % map->map_length; + unsigned int kx; + + GNUNET_assert (NULL != map); + memcpy (&kx, key, sizeof (kx)); + return kx % map->map_length; } -- 2.25.1