From 39ea1cd4283a77066d5f63b90146dfb17de813a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Tue, 4 Dec 2018 12:39:10 +0100 Subject: [PATCH] Fix uninitialized variable peer_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by GCC ``` minetest/src/server.cpp:996:42: warning: ‘peer_id’ may be used uninitialized in this function [-Wmaybe-uninitialized] errorstream << "ProcessData: peer=" << peer_id << e.what() << std::endl; ``` --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index ed1ac326e..f9550c54f 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -980,7 +980,7 @@ void Server::AsyncRunStep(bool initial_step) void Server::Receive() { - session_t peer_id; + session_t peer_id = 0; try { NetworkPacket pkt; m_con->Receive(&pkt);