]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam.c: Fixed compilation warning
authorSteve Holme <steve_holme@hotmail.com>
Fri, 8 Aug 2014 11:03:34 +0000 (12:03 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Fri, 8 Aug 2014 10:24:43 +0000 (11:24 +0100)
warning: `orig_opt' might be used uninitialized in this function

src/tool_getparam.c

index e8414e9005af80d1cf44ec6a0e82648005678094..180878baba7bbeed5135c27e22fa1d5a6afdbb8d 100644 (file)
@@ -1811,7 +1811,7 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
 {
   int i;
   bool stillflags;
-  char *orig_opt;
+  char *orig_opt = NULL;
   ParameterError result = PARAM_OK;
   struct OperationConfig *operation = config->first;
 
@@ -1879,7 +1879,7 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
      result != PARAM_ENGINES_REQUESTED) {
     const char *reason = param2text(result);
 
-    if(!curlx_strequal(":", orig_opt))
+    if(orig_opt && !curlx_strequal(":", orig_opt))
       helpf(config->errors, "option %s: %s\n", orig_opt, reason);
     else
       helpf(config->errors, "%s\n", reason);