chiark / gitweb /
dump-runlisp-image.c: Initialize the random number generator a bit.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 13 May 2021 13:50:27 +0000 (14:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 13 May 2021 13:56:08 +0000 (14:56 +0100)
This is only used to pick names for temporary directories, so it doesn't
matter that it's rather predictable.  Indeed, even using the same
sequence every time wasn't particularly bad, but we can do better, and
so we should.

dump-runlisp-image.c

index 7bd9ebaa7eeb5f5fe671dcb4749e4a2e996abf6f..97f854d7c649b5023d3a5bc69b87795a1c77e65b 100644 (file)
@@ -1408,6 +1408,7 @@ int main(int argc, char *argv[])
   /* Initial setup. */
   set_progname(argv[0]);
   init_config();
+  srand(time(0));
 
   /* Parse the options. */
   optprog = (/*unconst*/ char *)progname;