aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2018-07-08 17:16:34 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2018-07-09 18:09:05 +0200
commit424f1cfefbace57e5873e614a43ff14b251bbc7e (patch)
tree91c690109361cdc64b1651b7545469f2caed7b34
parent07f7c93f92c15e1a4a6489a05b1eb4c7b33cf6a4 (diff)
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
-rw-r--r--lib/vtls/schannel.c2
1 files changed, 1 insertions, 1 deletions
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;