mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
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
This commit is contained in:
parent
07f7c93f92
commit
424f1cfefb
@ -216,7 +216,7 @@ get_alg_id_by_name(char *name)
|
|||||||
{
|
{
|
||||||
char tmp[LONGEST_ALG_ID] = { 0 };
|
char tmp[LONGEST_ALG_ID] = { 0 };
|
||||||
char *nameEnd = strchr(name, ':');
|
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);
|
min(strlen(name), LONGEST_ALG_ID - 1);
|
||||||
strncpy(tmp, name, n);
|
strncpy(tmp, name, n);
|
||||||
tmp[n] = 0;
|
tmp[n] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user