diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-11 17:35:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-11 18:00:22 +0300 |
commit | 52c7195a8ee91f95ef134d9798a47ea313df16c8 (patch) | |
tree | ca1f32cfadce611a1820b50f5386c02cd2ce06ae /src/net/tmwa/network.cpp | |
parent | f1b82c1b06604c2c1eed750a6c980aa0b5355560 (diff) | |
download | ManaVerse-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.gz ManaVerse-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.bz2 ManaVerse-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.xz ManaVerse-52c7195a8ee91f95ef134d9798a47ea313df16c8.zip |
Second part of checks from Parasoft C++ Test.
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r-- | src/net/tmwa/network.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index 9c1508ccb..515b66c89 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -144,12 +144,12 @@ void Network::dispatchMessages() SDL_mutexP(mMutexIn); BLOCK_START("Network::dispatchMessages 2") const int msgId = readWord(0); - int len; + int len = -1; if (msgId == SMSG_SERVER_VERSION_RESPONSE) len = 10; else if (msgId == SMSG_UPDATE_HOST2) len = -1; - else + else if (msgId >= 0 && msgId < messagesSize) len = packet_lengths[msgId]; if (len == -1) |