Skip to content

Commit

Permalink
fixed slop from segfaulting when options were provided incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
naelstrof committed Feb 26, 2017
1 parent 359b426 commit d50c58c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/options.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit d50c58c

Please sign in to comment.