diff mbox series

[ustream-ssl,06/12] ustream-mbedtls: fix comparison of integers of different signs

Message ID 20201210154134.794-7-ynezz@true.cz
State Accepted
Delegated to: Petr Štetiar
Headers show
Series fixes, improvements and CI | expand

Commit Message

Petr Štetiar Dec. 10, 2020, 3:41 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c
index 9f73c5836034..3424743c6452 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)