From 217bf3d3e163455c6864ddcea77b66642d24ebfa Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 22 Jan 2019 06:47:36 -0700 Subject: [PATCH] fixed finding module index in main() --- QnetITAP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/QnetITAP.cpp b/QnetITAP.cpp index 189cedd..07efd32 100644 --- a/QnetITAP.cpp +++ b/QnetITAP.cpp @@ -589,6 +589,7 @@ int main(int argc, const char **argv) printf("This is free software, and you are welcome to distribute it\nunder certain conditions that are discussed in the LICENSE file.\n\n"); return 0; } + const char *qn = strstr(argv[0], "qnitap"); if (NULL == qn) { fprintf(stderr, "Error finding 'qnitap' in %s!\n", argv[0]); @@ -597,7 +598,7 @@ int main(int argc, const char **argv) qn += 6; int assigned_module; - switch (argv[1][0]) { + switch (*qn) { case NULL: assigned_module = -1; break;