Don't make assumptions about where the config file is.

This commit is contained in:
Jordan Bancino 2022-11-23 14:31:05 +00:00
parent be3b73f2af
commit 84f311ae09

View file

@ -132,7 +132,7 @@ main(int argc, char **argv)
/* Arg parsing */ /* Arg parsing */
int opt; int opt;
int flags = 0; int flags = 0;
char *configArg = "/etc/telodendria.conf"; char *configArg = NULL;
/* Config file */ /* Config file */
FILE *configFile = NULL; FILE *configFile = NULL;
@ -205,7 +205,13 @@ main(int argc, char **argv)
goto finish; goto finish;
} }
if (strcmp(configArg, "-") == 0) if (!configArg)
{
Log(lc, LOG_ERROR, "No configuration file specified.");
exit = EXIT_FAILURE;
goto finish;
}
else if (strcmp(configArg, "-") == 0)
{ {
configFile = stdin; configFile = stdin;
} }