patch-playlist_c 500 B

1234567891011121314151617
  1. $OpenBSD: patch-playlist_c,v 1.1.1.1 2016/07/10 10:40:43 czarkoff Exp $
  2. Replace rand(3)-based computation with arc4random_uniform(3).
  3. --- playlist.c.orig Sun Jun 5 13:54:04 2016
  4. +++ playlist.c Sun Jun 5 13:58:53 2016
  5. @@ -774,8 +774,7 @@ void plist_shuffle (struct plist *plist)
  6. int i;
  7. for (i = 0; i < plist->num; i++)
  8. - plist_swap (plist, i,
  9. - (rand()/(float)RAND_MAX) * (plist->num - 1));
  10. + plist_swap (plist, i, arc4random_uniform(plist->num));
  11. rb_clear (&plist->search_tree);