Browse Source

fixed slop from segfaulting when options were provided incorrectly

naelstrof 7 years ago
parent
commit
d50c58c630
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt View File

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
22
 include_directories("${PROJECT_BINARY_DIR}")
23
 
23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.33")
24
+add_definitions(-DSLOP_VERSION="v5.3.34")
25
 
25
 
26
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
src/options.cpp View File

38
             }
38
             }
39
             if ( i == check.name.length()-1 ) {
39
             if ( i == check.name.length()-1 ) {
40
                 if ( !check.isFlagArgument && argument.find("=") == std::string::npos ) {
40
                 if ( !check.isFlagArgument && argument.find("=") == std::string::npos ) {
41
-                    throw new std::invalid_argument("Expected `=` after " + arguments[i]);
41
+                    throw new std::invalid_argument("Expected `=` after " + argument);
42
                 }
42
                 }
43
                 if ( check.isFlagArgument && i+3 != argument.length() ) {
43
                 if ( check.isFlagArgument && i+3 != argument.length() ) {
44
                     throw new std::invalid_argument("Trailing characters on flag " + argument );
44
                     throw new std::invalid_argument("Trailing characters on flag " + argument );