aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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