From: Petr Štetiar Date: Thu, 10 Dec 2020 11:09:48 +0000 (+0100) Subject: ustream-mbedtls: fix comparison of integers of different signs X-Git-Url: http://git.openwrt.org/source?a=commitdiff_plain;h=cd2c3d12db432dd8a484e34818d1a30f84ad9fae;p=project%2Fustream-ssl.git ustream-mbedtls: fix comparison of integers of different signs Fixes following compiler extra warning: ustream-mbedtls.c:40:11: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] if (slen > len) ~~~~ ^ ~~~ Signed-off-by: Petr Štetiar --- diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c index 9f73c58..3424743 100644 --- a/ustream-mbedtls.c +++ b/ustream-mbedtls.c @@ -37,7 +37,7 @@ static int s_ustream_read(void *ctx, unsigned char *buf, size_t len) return 0; sbuf = ustream_get_read_buf(s, &slen); - if (slen > len) + if ((size_t) slen > len) slen = len; if (!slen)