diff options
author | erdgeist <> | 2007-01-12 01:22:03 +0000 |
---|---|---|
committer | erdgeist <> | 2007-01-12 01:22:03 +0000 |
commit | 575bf7081ffa5d79ab8a752aa15f9980982c97ce (patch) | |
tree | 3b7e6cb969eb1661ee4f25f19c145306c274ac51 /trackerlogic.c | |
parent | 805e46450cfa9400e30fd124c893dda18e050f2b (diff) |
casting does floor() by itself
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 2b8ffaf..b3aacc0 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -256,7 +256,7 @@ size_t return_peers_for_torrent( ot_torrent *torrent, unsigned int amount, char | |||
256 | r += sprintf( r, "d8:completei%ie10:incompletei%ie8:intervali600e5:peers%i:", seed_count, peer_count-seed_count, 6*amount ); | 256 | r += sprintf( r, "d8:completei%ie10:incompletei%ie8:intervali600e5:peers%i:", seed_count, peer_count-seed_count, 6*amount ); |
257 | for( index = 0; index < amount; ++index ) { | 257 | for( index = 0; index < amount; ++index ) { |
258 | double step = 1.8*((double)( peer_count - wert - 1 ))/((double)( amount - index )); | 258 | double step = 1.8*((double)( peer_count - wert - 1 ))/((double)( amount - index )); |
259 | int off = random() % (int)floor( step ); | 259 | int off = random() % (int)step; |
260 | off = 1 + ( off % ( peer_count - wert - 1 )); | 260 | off = 1 + ( off % ( peer_count - wert - 1 )); |
261 | wert += off; pool_offset += off; | 261 | wert += off; pool_offset += off; |
262 | 262 | ||