# HG changeset patch # User reimar # Date 1099694716 0 # Node ID a6b4bfa42178d7acb95176baa62ea3259af86d1e # Parent e03eefa560d8342fe4b11257b5fe8e6b9b36de1a fix "last file is always played last" bug. diff -r e03eefa560d8 -r a6b4bfa42178 playtree.c --- a/playtree.c Fri Nov 05 22:37:36 2004 +0000 +++ b/playtree.c Fri Nov 05 22:45:16 2004 +0000 @@ -525,7 +525,7 @@ if(!count) return NULL; - r = (int)((count-1.0) * rand() / RAND_MAX); + r = (int)((float)(count) * rand() / (RAND_MAX + 1.0)); for(i = head ; i ; i=i->next) { if(!(i->flags & PLAY_TREE_RND_PLAYED)) r--;