]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
easygetopt: pass a valid enum to avoid compiler warning
authorDaniel Stenberg <daniel@haxx.se>
Sat, 5 Sep 2020 10:52:03 +0000 (12:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 5 Sep 2020 12:44:11 +0000 (14:44 +0200)
"integer constant not in range of enumerated type 'CURLoption'"

Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/commit/6ebe63fac23f38df911edc348e8ccc72280f9434#commitcomment-42042843

Closes #5915

lib/easygetopt.c

index c4c6f631c39886c28efac8c3638ce5e3d14fc89b..cac8378e7ebbb7ce32313bd48eeac8c03dceb05c 100644 (file)
@@ -51,7 +51,8 @@ static struct curl_easyoption *lookup(const char *name, CURLoption id)
 
 const struct curl_easyoption *curl_easy_option_by_name(const char *name)
 {
-  return lookup(name, 0);
+  /* when name is used, the id argument is ignored */
+  return lookup(name, CURLOPT_LASTENTRY);
 }
 
 const struct curl_easyoption *curl_easy_option_by_id(CURLoption id)