From 080ee3b2a1fbc9af127297fa2e4ee401cb6e1ee1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 31 Oct 2013 23:47:22 +0100 Subject: [PATCH] ByteBuffer: Writing a string doesn't modify it (missing const). --- source/ByteBuffer.cpp | 2 +- source/ByteBuffer.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ByteBuffer.cpp b/source/ByteBuffer.cpp index 6659b4dd4..bccd1c48b 100644 --- a/source/ByteBuffer.cpp +++ b/source/ByteBuffer.cpp @@ -555,7 +555,7 @@ bool cByteBuffer::WriteVarInt(UInt32 a_Value) -bool cByteBuffer::WriteVarUTF8String(AString & a_Value) +bool cByteBuffer::WriteVarUTF8String(const AString & a_Value) { CHECK_THREAD; CheckValid(); diff --git a/source/ByteBuffer.h b/source/ByteBuffer.h index 71ee4764e..21abb0377 100644 --- a/source/ByteBuffer.h +++ b/source/ByteBuffer.h @@ -62,7 +62,7 @@ public: bool ReadVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8 /// Reads VarInt, assigns it to anything that can be assigned from an UInt32 (unsigned short, char, Byte, double, ...) - template bool ReadVarUInt(T & a_Value) + template bool ReadVarInt(T & a_Value) { UInt32 v; bool res = ReadVarInt(v); @@ -84,7 +84,7 @@ public: bool WriteBool (bool a_Value); bool WriteBEUTF16String16(const AString & a_Value); // string length as BE short, then string as UTF-16BE bool WriteVarInt (UInt32 a_Value); - bool WriteVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8 + bool WriteVarUTF8String (const AString & a_Value); // string length as VarInt, then string as UTF-8 /// Reads a_Count bytes into a_Buffer; returns true if successful bool ReadBuf(void * a_Buffer, int a_Count);