]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
fixed rand init a bit to use more bits of the pid
authorR.E. Wolff <R.E.Wolff@BitWizard.nl>
Mon, 25 May 2026 18:03:14 +0000 (20:03 +0200)
committerR.E. Wolff <R.E.Wolff@BitWizard.nl>
Mon, 25 May 2026 18:03:14 +0000 (20:03 +0200)
ui/mtr.c

index de47683fe5734bf7cd5869979ecce6176ade7db8..c3b66b08b0f4ff5b5d389a6931372ea889c49b55 100644 (file)
--- a/ui/mtr.c
+++ b/ui/mtr.c
@@ -830,7 +830,7 @@ static void init_rand(
     struct timeval tv;
 
     gettimeofday(&tv, NULL);
-    srand(((getpid() & 0xffff) << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);
+    srand((getpid() ^ (getuid() << 16) ^ tv.tv_sec ^ tv.tv_usec);
 }
 
 /*