From: Christian Grothoff Date: Wed, 13 Nov 2013 21:51:21 +0000 (+0000) Subject: -avoid bus error on sparc X-Git-Tag: initial-import-from-subversion-38251~6127 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a256932620856c72b3dd3bd53d8aef86c4688abc;p=oweals%2Fgnunet.git -avoid bus error on sparc --- 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; }