From d50c58c630ccfd51f1e8bd83056e64ef5236a3cf Mon Sep 17 00:00:00 2001 From: naelstrof Date: Sun, 26 Feb 2017 14:35:06 -0700 Subject: [PATCH] fixed slop from segfaulting when options were provided incorrectly --- CMakeLists.txt | 2 +- src/options.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e12f20..2acdb28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ endif() include_directories("${PROJECT_BINARY_DIR}") -add_definitions(-DSLOP_VERSION="v5.3.33") +add_definitions(-DSLOP_VERSION="v5.3.34") # The names have to be unique unfortunately. set(EXECUTABLE_NAME "slop") diff --git a/src/options.cpp b/src/options.cpp index d6fc97f..60e34a2 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -38,7 +38,7 @@ int Options::validateStringOption( int argc, char** argv, int argumentIndex ) { } if ( i == check.name.length()-1 ) { if ( !check.isFlagArgument && argument.find("=") == std::string::npos ) { - throw new std::invalid_argument("Expected `=` after " + arguments[i]); + throw new std::invalid_argument("Expected `=` after " + argument); } if ( check.isFlagArgument && i+3 != argument.length() ) { throw new std::invalid_argument("Trailing characters on flag " + argument );