aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2018-12-04 12:39:10 +0100
committerLoïc Blot <loic.blot@unix-experience.fr>2018-12-04 12:39:10 +0100
commit39ea1cd4283a77066d5f63b90146dfb17de813a8 (patch)
tree55e1efd90c6fee2642f76859ada0ccf854812cf1
parent6f426056f1bedbf807595af0bd4812a8f3ef34e7 (diff)
downloadminetest-39ea1cd4283a77066d5f63b90146dfb17de813a8.tar.gz
minetest-39ea1cd4283a77066d5f63b90146dfb17de813a8.tar.bz2
minetest-39ea1cd4283a77066d5f63b90146dfb17de813a8.zip
Fix uninitialized variable peer_id
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; ```
-rw-r--r--src/server.cpp2
1 files changed, 1 insertions, 1 deletions
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);