Skip to content

Commit

Permalink
Merge pull request #1 from BrunoDutertre/master
Browse files Browse the repository at this point in the history
Segfault when run without a seed
  • Loading branch information
arminbiere authored Mar 3, 2021
2 parents 0e8214d + a129f47 commit 4b14e95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scranfilize.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ static void init (int argc, char ** argv) {
}

if (seed < 0) {
uint64_t t = 8526563 * (unsigned long) times (0);
struct tms buffer;
uint64_t t = 8526563 * (unsigned long) times (&buffer);
uint64_t p = 3944621 * (unsigned long) getpid ();
uint64_t tmp = t + p;
seed = tmp & 0xffffffff;
Expand Down

0 comments on commit 4b14e95

Please sign in to comment.