diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-13 21:51:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-13 21:51:21 +0000 |
commit | a256932620856c72b3dd3bd53d8aef86c4688abc (patch) | |
tree | 153504027f535a568a59f57aa85443ae0ba2e4ba /src/util/container_multipeermap.c | |
parent | 5fb6bafdbd17f145f73d88a8788a98e45c212d02 (diff) | |
download | gnunet-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.c | 7 |
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 | |||
245 | idx_of (const struct GNUNET_CONTAINER_MultiPeerMap *map, | 245 | idx_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 | ||