Scan build: Argument with 'nonnull' attribute passed null

This commit is contained in:
mir
2023-10-31 11:53:42 +01:00
parent 82597e7e8f
commit e0ff84f67c
4 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -55,8 +55,9 @@ void randominit(unsigned long seed_init)
unsigned long seed = seed_init;
if (seed_init == 0)
fill_random(&seed, sizeof(seed));
if (getenv("OAI_RNGSEED"))
seed = atoi(getenv("OAI_RNGSEED"));
const char* str_oai_rngseed = getenv("OAI_RNGSEED");
if (str_oai_rngseed != NULL)
seed = atoi(str_oai_rngseed);
printf("Initializing random number generator, seed %lu\n", seed);
// initialize uniformrandom RNG