diff options
| -rw-r--r-- | apps/playlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index cfa49d1..e3dc626 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -721,7 +721,7 @@ static int randomise_playlist(struct playlist_info* playlist, for(count = playlist->amount - 1; count >= 0; count--) { /* the rand is from 0 to RAND_MAX, so adjust to our value range */ - candidate = rand() % (count + 1); + candidate = rand() / (RAND_MAX / (count + 1)); /* now swap the values at the 'count' and 'candidate' positions */ store = playlist->indices[candidate]; |