Fix Clang warnings: ariable 'status' is used uninitialized

warning: variable 'status' is used uninitialized whenever 'if' condition
is false [-Wsometimes-uninitialized]
        else if(state_string == "away")
                ^~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Phenom 2017-04-07 18:21:49 +02:00 committed by csoler
parent a3a53b970d
commit 19196e2cb0

View File

@ -234,7 +234,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp)
std::string state_string;
req.mStream << makeKeyValueReference("state_string", state_string);
uint32_t status;
uint32_t status = RS_STATUS_OFFLINE;
if(state_string == "online")
status = RS_STATUS_ONLINE;
else if(state_string == "busy")