Bladeren bron

fixed slop from segfaulting when options were provided incorrectly

naelstrof 7 jaren geleden
bovenliggende
commit
d50c58c630
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt Bestand weergeven

@@ -21,7 +21,7 @@ endif()
21 21
 
22 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 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
src/options.cpp Bestand weergeven

@@ -38,7 +38,7 @@ int Options::validateStringOption( int argc, char** argv, int argumentIndex ) {
38 38
             }
39 39
             if ( i == check.name.length()-1 ) {
40 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 43
                 if ( check.isFlagArgument && i+3 != argument.length() ) {
44 44
                     throw new std::invalid_argument("Trailing characters on flag " + argument );