Selaa lähdekoodia

fixed slop from segfaulting when options were provided incorrectly

naelstrof 7 vuotta sitten
vanhempi
commit
d50c58c630
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 );