From: Viktor Szakats Date: Tue, 4 Feb 2025 17:29:24 +0000 (+0100) Subject: cfilters: silence compiler warning X-Git-Tag: curl-8_12_0~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad9a8b77548f0b79cb7f198260ced5e129e80845;p=thirdparty%2Fcurl.git cfilters: silence compiler warning seen with gcc 4.4.0: ``` ../../lib/cfilters.c: In function 'Curl_conn_http_version': ../../lib/cfilters.c:523: error: conversion to 'unsigned char' from 'int' may alter its value ``` Ref: https://github.com/curl/curl/actions/runs/13124120573/job/36616761121?pr=15975#step:9:20 Follow-up to e83818cae1da495939aee5def1172ca1d20cc1e4 #16073 Closes #16171 --- diff --git a/lib/cfilters.c b/lib/cfilters.c index 8b05356151..3be08403aa 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -520,7 +520,7 @@ unsigned char Curl_conn_http_version(struct Curl_easy *data) if(cf->cft->flags & (CF_TYPE_IP_CONNECT|CF_TYPE_SSL)) break; } - return result ? 0 : v; + return (unsigned char)(result ? 0 : v); } bool Curl_conn_data_pending(struct Curl_easy *data, int sockindex)