mirror of
git://erdgeist.org/opentracker
synced 2025-02-22 09:01:29 +08:00
This memmove was for real...
This commit is contained in:
parent
b019607ba5
commit
de5dbad258
@ -178,13 +178,13 @@ size_t stats_top10_txt( char * reply ) {
|
||||
ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list;
|
||||
int idx = 9; while( (idx >= 0) && ( peer_list->peer_count > top10c[idx].val ) ) --idx;
|
||||
if ( idx++ != 9 ) {
|
||||
memcpy( top10c + idx + 1, top10c + idx, ( 9 - idx ) * sizeof( ot_record ) );
|
||||
memmove( top10c + idx + 1, top10c + idx, ( 9 - idx ) * sizeof( ot_record ) );
|
||||
top10c[idx].val = peer_list->peer_count;
|
||||
top10c[idx].torrent = (ot_torrent*)(torrents_list->data) + j;
|
||||
}
|
||||
idx = 9; while( (idx >= 0) && ( peer_list->seed_count > top10s[idx].val ) ) --idx;
|
||||
if ( idx++ != 9 ) {
|
||||
memcpy( top10s + idx + 1, top10s + idx, ( 9 - idx ) * sizeof( ot_record ) );
|
||||
memmove( top10s + idx + 1, top10s + idx, ( 9 - idx ) * sizeof( ot_record ) );
|
||||
top10s[idx].val = peer_list->seed_count;
|
||||
top10s[idx].torrent = (ot_torrent*)(torrents_list->data) + j;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user