From 1c525b601716d0bdcf3f0e3daec32e884e685499 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Sun, 8 Jul 2018 17:16:34 +0200 Subject: [PATCH] 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 --- lib/vtls/schannel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index b72542225bb0cb..382efb52505409 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;