From fc0551a8b6217b2d36e58e28c05d3b17237a1c71 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 25 Feb 2019 05:28:30 -0700 Subject: [PATCH] cleaned up module check --- QnetRemote.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/QnetRemote.cpp b/QnetRemote.cpp index 5a8e7a5..67f243c 100644 --- a/QnetRemote.cpp +++ b/QnetRemote.cpp @@ -39,7 +39,7 @@ #include "QnetConfigure.h" #include "UnixDgramSocket.h" -#define VERSION "v2.1" +#define VERSION "v2.2" int module; time_t tNow = 0; @@ -77,14 +77,13 @@ bool ReadCfgFile() std::string type; std::string path = "module_"; path.append(1, 'a'+module); - if (cfg.GetValue(path, estr, type, 1, 16)) { - fprintf(stderr, "%s not found!\n", path.c_str()); - return true; - } - if (type.compare("dvap") && type.compare("dvrptr") && type.compare("mmdvm") && type.compare("itap")) { - fprintf(stderr, "module type '%s' is invalid!\n", type.c_str()); + + if (! cfg.KeyExists(path)) { + fprintf(stderr, "%s not defined!\n", path.c_str()); return true; } + cfg.GetValue(path, estr, type, 1, 16); + cfg.GetValue(path+"_callsign", type, REPEATER, 0, 6); if (REPEATER.length() < 4) { if (cfg.GetValue("ircddb_login", estr, REPEATER, 3, 6)) {