]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
fade-throbber: Use new ply_get_random_number function
authorRay Strode <rstrode@redhat.com>
Mon, 4 Dec 2023 00:06:32 +0000 (19:06 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 4 Dec 2023 10:48:06 +0000 (05:48 -0500)
src/plugins/splash/fade-throbber/plugin.c

index 18ad72e93e06a0ab58cc387b1d3c20308fe226fb..4b423f7177399984b1ecf730e3eafd49fe5eaf9a 100644 (file)
@@ -186,7 +186,6 @@ create_plugin (ply_key_file_t *key_file)
         ply_boot_splash_plugin_t *plugin;
         char *image_dir, *image_path;
 
-        srand ((int) ply_get_timestamp ());
         plugin = calloc (1, sizeof(ply_boot_splash_plugin_t));
         plugin->start_time = 0.0;
 
@@ -927,8 +926,8 @@ view_add_star (view_t *view)
 
         node = NULL;
         do {
-                x = rand () % screen_width;
-                y = rand () % screen_height;
+                x = ply_get_random_number (0, screen_width);
+                y = ply_get_random_number (0, screen_height);
 
                 if ((x <= logo_area.x + logo_area.width)
                     && (x >= logo_area.x)
@@ -965,7 +964,7 @@ view_add_star (view_t *view)
                 }
         } while (node != NULL);
 
-        star = star_new (x, y, (double) ((rand () % 50) + 1));
+        star = star_new (x, y, (double) ((ply_get_random_number (0, 50)) + 1));
         ply_list_append_data (view->stars, star);
 }