]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV
authorDaniel Stenberg <daniel@haxx.se>
Thu, 12 Jan 2023 22:06:15 +0000 (23:06 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Jan 2023 09:39:23 +0000 (10:39 +0100)
Follow-up to 2ed0e1f70ee176edf3d2

Closes #10286

src/tool_getparam.c

index cecaf4b8d53d6967b53b870372b7575c9c28d8f8..68258e9d1bf4aa3d133fc8fba8c44464b0fb6b65 100644 (file)
@@ -689,10 +689,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
   ParameterError err;
   bool toggle = TRUE; /* how to switch boolean options, on or off. Controlled
                          by using --OPTION or --no-OPTION */
-#ifdef HAVE_WRITABLE_ARGV
-  argv_item_t clearthis = NULL;
-#endif
-
   static const char *redir_protos[] = {
     "http",
     "https",
@@ -700,6 +696,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
     "ftps",
     NULL
   };
+#ifdef HAVE_WRITABLE_ARGV
+  argv_item_t clearthis = NULL;
+#else
+  (void)cleararg;
+#endif
 
   *usedarg = FALSE; /* default is that we don't use the arg */