Bläddra i källkod

fixed slop from segfaulting when options were provided incorrectly

naelstrof 7 år sedan
förälder
incheckning
d50c58c630
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt Visa fil

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 Visa fil

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