- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of...
[oweals/gnunet.git] / src / util / container_multipeermap.c
index 8ec3a2077e2c3efd539b6c26fa82fe8cce57eeb8..f5d3b4ef42c29660e77b385ae37b0ca260b6eebf 100644 (file)
@@ -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;
 }