From 2e54c8fdfa237f84e8d48b30bf4811ba7ed84327 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 Nov 2013 21:50:43 +0000 Subject: (svn r26056) -Fix: a number of possibly uninitialised variables --- src/network/core/tcp_admin.cpp | 4 +++- src/network/core/tcp_game.cpp | 8 +++----- src/network/core/tcp_game.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/network/core') diff --git a/src/network/core/tcp_admin.cpp b/src/network/core/tcp_admin.cpp index 0a3153319..636696e2c 100644 --- a/src/network/core/tcp_admin.cpp +++ b/src/network/core/tcp_admin.cpp @@ -29,9 +29,11 @@ assert_compile((int)CRR_END == (int)ADMIN_CRR_END); * Create the admin handler for the given socket. * @param s The socket to communicate over. */ -NetworkAdminSocketHandler::NetworkAdminSocketHandler(SOCKET s) +NetworkAdminSocketHandler::NetworkAdminSocketHandler(SOCKET s) : status(ADMIN_STATUS_INACTIVE) { this->sock = s; + this->admin_name[0] = '\0'; + this->admin_version[0] = '\0'; } NetworkAdminSocketHandler::~NetworkAdminSocketHandler() diff --git a/src/network/core/tcp_game.cpp b/src/network/core/tcp_game.cpp index 711d6a2b7..54d222495 100644 --- a/src/network/core/tcp_game.cpp +++ b/src/network/core/tcp_game.cpp @@ -26,12 +26,10 @@ * Create a new socket for the game connection. * @param s The socket to connect with. */ -NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) +NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) : info(NULL), + last_frame(_frame_counter), last_frame_server(_frame_counter), last_packet(_realtime_tick) { - this->sock = s; - this->last_frame = _frame_counter; - this->last_frame_server = _frame_counter; - this->last_packet = _realtime_tick; + this->sock = s; } /** diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 761399639..5c6cb5c34 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -137,7 +137,7 @@ class CommandQueue { public: /** Initialise the command queue. */ - CommandQueue() : first(NULL), last(NULL) {} + CommandQueue() : first(NULL), last(NULL), count(0) {} /** Clear the command queue. */ ~CommandQueue() { this->Free(); } void Append(CommandPacket *p); -- cgit v1.2.3-70-g09d2