From 9c891b64ffd14bc8216dbd5eb60816043af265b6 Mon Sep 17 00:00:00 2001 From: eugene Date: Tue, 11 May 2021 11:21:29 -0400 Subject: net: initialize nMessageSize to max uint32_t instead of -1 nMessageSize is uint32_t and is set to -1. This will warn with -fsanitize=implicit-integer-sign-change. --- src/protocol.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index f183db0501..c73484bdf6 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -51,7 +52,7 @@ public: char pchMessageStart[MESSAGE_START_SIZE]; char pchCommand[COMMAND_SIZE]; - uint32_t nMessageSize; + uint32_t nMessageSize{std::numeric_limits::max()}; uint8_t pchChecksum[CHECKSUM_SIZE]; }; -- cgit v1.2.3