From 84f311ae097658e0d9272a7082d66bb1c4f3cf21 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 23 Nov 2022 14:31:05 +0000 Subject: [PATCH] Don't make assumptions about where the config file is. --- src/Telodendria.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Telodendria.c b/src/Telodendria.c index b9c2411..fce8265 100644 --- a/src/Telodendria.c +++ b/src/Telodendria.c @@ -132,7 +132,7 @@ main(int argc, char **argv) /* Arg parsing */ int opt; int flags = 0; - char *configArg = "/etc/telodendria.conf"; + char *configArg = NULL; /* Config file */ FILE *configFile = NULL; @@ -205,7 +205,13 @@ main(int argc, char **argv) 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; }