aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_multipeermap.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-13 21:51:21 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-13 21:51:21 +0000
commita256932620856c72b3dd3bd53d8aef86c4688abc (patch)
tree153504027f535a568a59f57aa85443ae0ba2e4ba /src/util/container_multipeermap.c
parent5fb6bafdbd17f145f73d88a8788a98e45c212d02 (diff)
downloadgnunet-a256932620856c72b3dd3bd53d8aef86c4688abc.tar.gz
gnunet-a256932620856c72b3dd3bd53d8aef86c4688abc.zip
-avoid bus error on sparc
Diffstat (limited to 'src/util/container_multipeermap.c')
-rw-r--r--src/util/container_multipeermap.c7
1 files 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
245idx_of (const struct GNUNET_CONTAINER_MultiPeerMap *map, 245idx_of (const struct GNUNET_CONTAINER_MultiPeerMap *map,
246 const struct GNUNET_PeerIdentity *key) 246 const struct GNUNET_PeerIdentity *key)
247{ 247{
248 GNUNET_assert (map != NULL); 248 unsigned int kx;
249 return (*(unsigned int *) key) % map->map_length; 249
250 GNUNET_assert (NULL != map);
251 memcpy (&kx, key, sizeof (kx));
252 return kx % map->map_length;
250} 253}
251 254
252 255