summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-09-05 12:52:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-09-05 14:44:11 +0200
commit879007f8118771f4896334731aaca5850a154675 (patch)
treefcf68ab5a73670ff286c47a3932db15b421810b1
parenta86cc7e2ab96d3d2bda380c9a1a9bb3c80bb422f (diff)
downloadcurl-879007f8118771f4896334731aaca5850a154675.tar.gz
easygetopt: pass a valid enum to avoid compiler warning
"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
-rw-r--r--lib/easygetopt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/easygetopt.c b/lib/easygetopt.c
index c4c6f631c..cac8378e7 100644
--- a/lib/easygetopt.c
+++ b/lib/easygetopt.c
@@ -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)