From 6aa5dba57968a5b196ca2b527288a3187a8b150d Mon Sep 17 00:00:00 2001 From: Lucas David Date: Tue, 27 Jul 2021 15:39:51 +0200 Subject: [PATCH] + buf[1] += static_cast(size); - buf[1] += size; ~ Warning was triggered by 'size' being std::size_t and lossing data by implicit casting to a narrower type. This behavior seems correct, then we can explicit cast it. --- include/crow/websocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crow/websocket.h b/include/crow/websocket.h index 6b2d4e73d..4c4f2b944 100644 --- a/include/crow/websocket.h +++ b/include/crow/websocket.h @@ -194,7 +194,7 @@ namespace crow buf[0] += opcode; if (size < 126) { - buf[1] += size; + buf[1] += static_cast(size); return {buf, buf+2}; } else if (size < 0x10000)