From: Marcel Raad Date: Sun, 8 Jul 2018 15:16:34 +0000 (+0200) Subject: schannel: fix -Wsign-compare warning X-Git-Tag: curl-7_61_0~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=424f1cfefbace57e5873e614a43ff14b251bbc7e;p=curl schannel: fix -Wsign-compare warning MinGW warns: /lib/vtls/schannel.c:219:64: warning: signed and unsigned type in conditional expression [-Wsign-compare] Fix this by casting the ptrdiff_t to size_t as we know it's positive. Closes https://github.com/curl/curl/pull/2721 --- diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index b72542225..382efb525 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -216,7 +216,7 @@ get_alg_id_by_name(char *name) { char tmp[LONGEST_ALG_ID] = { 0 }; char *nameEnd = strchr(name, ':'); - size_t n = nameEnd ? min(nameEnd - name, LONGEST_ALG_ID - 1) : \ + size_t n = nameEnd ? min((size_t)(nameEnd - name), LONGEST_ALG_ID - 1) : \ min(strlen(name), LONGEST_ALG_ID - 1); strncpy(tmp, name, n); tmp[n] = 0;