瀏覽代碼

fixed slop from segfaulting when options were provided incorrectly

naelstrof 7 年之前
父節點
當前提交
d50c58c630
共有 2 個檔案被更改,包括 2 行新增2 行删除
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      src/options.cpp

+ 1
- 1
CMakeLists.txt 查看文件

@@ -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 查看文件

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