Allow path to config file to be specified in command args
This commit is contained in:
parent
784e0a0f91
commit
f8a2678deb
@ -22,7 +22,7 @@ static void *pool_alloc(int size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
free_ptr = &pool[0];
|
||||
|
||||
@ -38,8 +38,9 @@ int main(void)
|
||||
}
|
||||
srand(seed);
|
||||
|
||||
const char *config_path = argc > 1 ? argv[1] : "rotagen.conf";
|
||||
memset(&conf, 0, sizeof(conf));
|
||||
read_config("rotagen.conf", &conf);
|
||||
read_config(config_path, &conf);
|
||||
|
||||
struct slot_result *rota
|
||||
= pool_alloc(conf.num_slots * sizeof(struct slot_result));
|
||||
|
Loading…
x
Reference in New Issue
Block a user