diff options
-rw-r--r-- | ot_clean.c | 2 | ||||
-rw-r--r-- | ot_vector.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -33,7 +33,7 @@ static ssize_t clean_single_bucket( ot_peer *peers, size_t peer_count, time_t ti | |||
33 | while( peers < last_peer ) | 33 | while( peers < last_peer ) |
34 | if( ( timediff = timedout + OT_PEERTIME( peers ) ) < OT_PEER_TIMEOUT ) { | 34 | if( ( timediff = timedout + OT_PEERTIME( peers ) ) < OT_PEER_TIMEOUT ) { |
35 | OT_PEERTIME( peers ) = timediff; | 35 | OT_PEERTIME( peers ) = timediff; |
36 | *(uint64_t*)(insert_point++) = *(uint64_t*)(peers++); | 36 | memcpy( insert_point++, peers++, sizeof(ot_peer)); |
37 | } else | 37 | } else |
38 | if( OT_PEERFLAG( peers++ ) & PEER_FLAG_SEEDING ) | 38 | if( OT_PEERFLAG( peers++ ) & PEER_FLAG_SEEDING ) |
39 | (*removed_seeders)++; | 39 | (*removed_seeders)++; |
diff --git a/ot_vector.c b/ot_vector.c index f7481f1..a69d9a5 100644 --- a/ot_vector.c +++ b/ot_vector.c | |||
@@ -244,7 +244,7 @@ void vector_redistribute_buckets( ot_peerlist * peer_list ) { | |||
244 | bucket_dest->space *= OT_VECTOR_GROW_RATIO; | 244 | bucket_dest->space *= OT_VECTOR_GROW_RATIO; |
245 | } | 245 | } |
246 | peers_new = (ot_peer*)bucket_dest->data; | 246 | peers_new = (ot_peer*)bucket_dest->data; |
247 | *(uint64_t*)(peers_new + bucket_dest->size++) = *(uint64_t*)(peers_old++); | 247 | memcpy(peers_new + bucket_dest->size++, peers_old++, sizeof(ot_peer)); |
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||