summaryrefslogtreecommitdiff
path: root/src/net/manaserv
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 10:13:40 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 10:13:40 +0100
commiteb2e62609992ab8b47f8805f2bc2cafce271b66f (patch)
tree58d6c387f910e3a3348a6528127f4216b524ec57 /src/net/manaserv
parent05dc1666dc794ed6aa7f6568b768c652f8922c4e (diff)
parent8d06606835e3d01f537ebe96de8b216e64a1f969 (diff)
downloadmana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.gz
mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.bz2
mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.tar.xz
mana-eb2e62609992ab8b47f8805f2bc2cafce271b66f.zip
Merge branch 'master' into lpc2012lpc2012
Diffstat (limited to 'src/net/manaserv')
-rw-r--r--src/net/manaserv/messagehandler.h2
-rw-r--r--src/net/manaserv/messagein.h5
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.