]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_multi_setopt: fix compiler warning "result is always false"
authorDaniel Stenberg <daniel@haxx.se>
Mon, 27 Jul 2020 21:49:42 +0000 (23:49 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Jul 2020 21:37:01 +0000 (23:37 +0200)
On systems with 32 bit long the expression is always false. Avoid
the warning.

Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/commit/61a08508f6a458fe21bbb18cd2a9bac2f039452b#commitcomment-40941232
Closes #5736

lib/multi.c

index 2ad502756828c47fb2acc1738df87d6bcee05f6c..6b62ddaf7676c4e7d0f8ce24c399d4f5acbe67d0 100644 (file)
@@ -2962,9 +2962,7 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi,
       long streams = va_arg(param, long);
       if(streams < 1)
         streams = 100;
-      multi->max_concurrent_streams =
-        (streams > (long)INITIAL_MAX_CONCURRENT_STREAMS)?
-        INITIAL_MAX_CONCURRENT_STREAMS : (unsigned int)streams;
+      multi->max_concurrent_streams = curlx_sltoui(streams);
     }
     break;
   default: