diff options
Diffstat (limited to 'src/net/manaserv')
-rw-r--r-- | src/net/manaserv/messagehandler.h | 2 | ||||
-rw-r--r-- | src/net/manaserv/messagein.h | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/net/manaserv/messagehandler.h b/src/net/manaserv/messagehandler.h index 6e0221cb..8949d34e 100644 --- a/src/net/manaserv/messagehandler.h +++ b/src/net/manaserv/messagehandler.h @@ -41,7 +41,7 @@ class MessageHandler : public Net::MessageHandler virtual void handleMessage(MessageIn &msg) = 0; }; -typedef const std::auto_ptr<MessageHandler> MessageHandlerPtr; +typedef const std::unique_ptr<MessageHandler> MessageHandlerPtr; } // namespace ManaServ diff --git a/src/net/manaserv/messagein.h b/src/net/manaserv/messagein.h index 89ae5ed8..1edc4fe7 100644 --- a/src/net/manaserv/messagein.h +++ b/src/net/manaserv/messagein.h @@ -52,7 +52,10 @@ class MessageIn /** * Returns the length of unread data. */ - unsigned int getUnreadLength() const { return mLength - mPos; } + unsigned int getUnreadLength() const + { + return (mPos < mLength) ? mLength - mPos : 0; + } /** * Reads an unsigned 8-bit integer from the message. |