ustream-mbedtls: fix comparison of integers of different signs
authorPetr Štetiar <ynezz@true.cz>
Thu, 10 Dec 2020 11:09:48 +0000 (12:09 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 10 Dec 2020 11:24:34 +0000 (12:24 +0100)
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 <ynezz@true.cz>
ustream-mbedtls.c

index 9f73c58360348fc62534ad69d696a71ed7c636dd..3424743c64521105e6facf39a3035eec1284fc5a 100644 (file)
@@ -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)