From f46f6cddfae27bf76dc13e873f7271d6523698b9 Mon Sep 17 00:00:00 2001 From: Moritz W Date: Wed, 23 May 2018 22:46:01 +0200 Subject: [PATCH] reduce scope of bytesReceived in LinHttpHandler --- hueplusplus/LinHttpHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hueplusplus/LinHttpHandler.cpp b/hueplusplus/LinHttpHandler.cpp index c5ba891..ae00c80 100644 --- a/hueplusplus/LinHttpHandler.cpp +++ b/hueplusplus/LinHttpHandler.cpp @@ -178,12 +178,11 @@ std::vector LinHttpHandler::sendMulticast(const std::string & msg, std::string response; char buffer[2048] = {}; // receive buffer - ssize_t bytesReceived = 0; std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); while (std::chrono::steady_clock::now() - start < std::chrono::seconds(timeout)) { - bytesReceived = recv(socketFD, &buffer, 2048, MSG_DONTWAIT); + ssize_t bytesReceived = recv(socketFD, &buffer, 2048, MSG_DONTWAIT); if (bytesReceived < 0) { int errCode = errno; -- libgit2 0.21.4