diff options
author | erdgeist <> | 2009-01-21 00:11:57 +0000 |
---|---|---|
committer | erdgeist <> | 2009-01-21 00:11:57 +0000 |
commit | de5dbad258a076b53fa7dea78b233be3250110bc (patch) | |
tree | 6b14bc0c5414368dfb3e015f2ee91b78390817ad | |
parent | b019607ba543ed2b7a689aeb5da7e59aac5402e1 (diff) |
This memmove was for real...
-rw-r--r-- | ot_stats.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -178,13 +178,13 @@ size_t stats_top10_txt( char * reply ) { | |||
178 | ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; | 178 | ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list; |
179 | int idx = 9; while( (idx >= 0) && ( peer_list->peer_count > top10c[idx].val ) ) --idx; | 179 | int idx = 9; while( (idx >= 0) && ( peer_list->peer_count > top10c[idx].val ) ) --idx; |
180 | if ( idx++ != 9 ) { | 180 | if ( idx++ != 9 ) { |
181 | memcpy( top10c + idx + 1, top10c + idx, ( 9 - idx ) * sizeof( ot_record ) ); | 181 | memmove( top10c + idx + 1, top10c + idx, ( 9 - idx ) * sizeof( ot_record ) ); |
182 | top10c[idx].val = peer_list->peer_count; | 182 | top10c[idx].val = peer_list->peer_count; |
183 | top10c[idx].torrent = (ot_torrent*)(torrents_list->data) + j; | 183 | top10c[idx].torrent = (ot_torrent*)(torrents_list->data) + j; |
184 | } | 184 | } |
185 | idx = 9; while( (idx >= 0) && ( peer_list->seed_count > top10s[idx].val ) ) --idx; | 185 | idx = 9; while( (idx >= 0) && ( peer_list->seed_count > top10s[idx].val ) ) --idx; |
186 | if ( idx++ != 9 ) { | 186 | if ( idx++ != 9 ) { |
187 | memcpy( top10s + idx + 1, top10s + idx, ( 9 - idx ) * sizeof( ot_record ) ); | 187 | memmove( top10s + idx + 1, top10s + idx, ( 9 - idx ) * sizeof( ot_record ) ); |
188 | top10s[idx].val = peer_list->seed_count; | 188 | top10s[idx].val = peer_list->seed_count; |
189 | top10s[idx].torrent = (ot_torrent*)(torrents_list->data) + j; | 189 | top10s[idx].torrent = (ot_torrent*)(torrents_list->data) + j; |
190 | } | 190 | } |