From 7d37913b7bf5f2c845083f0b09772e48f49f4c07 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 3 Sep 2017 19:51:46 +0200 Subject: [PATCH] Fix error messages of command line argument parsers. (#119) The two error messages about missing arguments access an argument with an incorrect index because at these points in the code the *CurArg is not yet incremented. Also append line breaks to separate the messages from other notices and warnings that could occur. --- common/lc_application.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lc_application.cpp b/common/lc_application.cpp index a163205c..b7e66c80 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -123,13 +123,13 @@ void lcApplication::ParseIntegerArgument(int* CurArg, int argc, char* argv[], in else { *Value = 0; - printf("Invalid value specified for the %s argument.", argv[(*CurArg) - 1]); + printf("Invalid value specified for the %s argument.\n", argv[(*CurArg) - 1]); } } else { *Value = 0; - printf("Not enough parameters for the %s argument.", argv[(*CurArg) - 1]); + printf("Not enough parameters for the %s argument.\n", argv[(*CurArg)]); } } @@ -142,7 +142,7 @@ void lcApplication::ParseStringArgument(int* CurArg, int argc, char* argv[], con } else { - printf("No path specified after the %s argument.", argv[(*CurArg) - 1]); + printf("No path specified after the %s argument.\n", argv[(*CurArg)]); } }