From b542f3b3022351ebc32d1d2a97ebf70ed1edf612 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Oct 2020 12:17:17 +0300 Subject: [PATCH] SYNERGY-323 NO configuration available. Fix sonar "Code Smells". --- src/lib/synergy/ProtocolUtil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/synergy/ProtocolUtil.cpp b/src/lib/synergy/ProtocolUtil.cpp index 1d28ab0f6..de18dda21 100644 --- a/src/lib/synergy/ProtocolUtil.cpp +++ b/src/lib/synergy/ProtocolUtil.cpp @@ -61,7 +61,7 @@ ProtocolUtil::readf(synergy::IStream* stream, const char* fmt, ...) catch (XIO&) { result = false; } - catch (std::bad_alloc&) { + catch (const std::bad_alloc&) { result = false; } va_end(args); @@ -473,7 +473,7 @@ UInt16 ProtocolUtil::read2BytesInt(synergy::IStream * stream) std::array buffer = {}; read(stream, buffer.data(), BufferSize); - UInt16 Result = (static_cast(buffer[0]) << 8) | static_cast(buffer[1]); + UInt16 Result = static_cast((static_cast(buffer[0]) << 8) | static_cast(buffer[1])); LOG((CLOG_DEBUG2 "readf: read 2 byte integer: %d (0x%x)", Result, Result)); return Result;