diff options
-rw-r--r-- | src/eom-thumb-view.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c index b9065d8..eb40d01 100644 --- a/src/eom-thumb-view.c +++ b/src/eom-thumb-view.c @@ -841,7 +841,7 @@ eom_thumb_view_select_single (EomThumbView *thumbview, path = gtk_tree_path_new_from_indices (n_items - 1, -1); break; case EOM_THUMB_VIEW_SELECT_RANDOM: - path = gtk_tree_path_new_from_indices ((int)(((float)(n_items - 1) * rand()) / (float)(RAND_MAX + 1.f)), -1); + path = gtk_tree_path_new_from_indices (g_random_int_range (0, n_items), -1); break; } } else { @@ -879,7 +879,7 @@ eom_thumb_view_select_single (EomThumbView *thumbview, break; case EOM_THUMB_VIEW_SELECT_RANDOM: gtk_tree_path_free (path); - path = gtk_tree_path_new_from_indices ((int)(((float)(n_items - 1) * rand()) / (float)(RAND_MAX + 1.f)), -1); + path = gtk_tree_path_new_from_indices (g_random_int_range (0, n_items), -1); break; } } |