Browse Source

[1812] Initialize srandom() with seed other than 0 when not using a random seed

This is because random() always returns 0 on OpenBSD 5.0, when
the RNG is initialized with srandom(0).
Mukund Sivaraman 13 years ago
parent
commit
7b7252d044
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/nsas/hash.cc

+ 1 - 1
src/lib/nsas/hash.cc

@@ -101,7 +101,7 @@ Hash::Hash(uint32_t tablesize, uint32_t maxkeylen, bool randomise) :
         init_value.curtime = time(NULL);
     }
     else {
-        init_value.seed = 0;
+        init_value.seed = 1;
     }
     srandom(init_value.seed);