From bdd2a88890ea7819371047fa53eeca87209147d0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 19 Aug 2012 23:10:19 +0300 Subject: Fix compilation warnings. --- src/net/eathena/network.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/network.cpp') diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 5cfe0af1a..67018e7b5 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -218,7 +218,7 @@ MessageIn Network::getNextMessage() SDL_mutexP(mMutex); int msgId = readWord(0); - int len; + int len = -1; if (msgId == SMSG_SERVER_VERSION_RESPONSE) { len = 10; @@ -229,8 +229,11 @@ MessageIn Network::getNextMessage() } else { - if (msgId >= 0 && msgId < sizeof(packet_lengths) / sizeof (short)) + if (msgId >= 0 && msgId < static_cast( + sizeof(packet_lengths) / sizeof (short))) + { len = packet_lengths[msgId]; + } } if (len == -1) -- cgit v1.2.3-70-g09d2