mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9616] Fix ByteBuffer::appendPackGUID appending a superfluous byte.
This commit is contained in:
parent
420429fdcf
commit
f7e7e6b849
2 changed files with 11 additions and 10 deletions
|
|
@ -385,21 +385,22 @@ class ByteBuffer
|
|||
|
||||
void appendPackGUID(uint64 guid)
|
||||
{
|
||||
if (_storage.size() < _wpos + sizeof(guid) + 1)
|
||||
_storage.resize(_wpos + sizeof(guid) + 1);
|
||||
|
||||
size_t mask_position = wpos();
|
||||
*this << uint8(0);
|
||||
for(uint8 i = 0; i < 8; ++i)
|
||||
uint8 packGUID[8+1];
|
||||
packGUID[0] = 0;
|
||||
size_t size = 1;
|
||||
for (uint8 i = 0; guid != 0; ++i)
|
||||
{
|
||||
if(guid & 0xFF)
|
||||
if (guid & 0xFF)
|
||||
{
|
||||
_storage[mask_position] |= uint8(1 << i);
|
||||
*this << uint8(guid & 0xFF);
|
||||
packGUID[0] |= uint8(1 << i);
|
||||
packGUID[size] = uint8(guid & 0xFF);
|
||||
++size;
|
||||
}
|
||||
|
||||
guid >>= 8;
|
||||
}
|
||||
|
||||
append(packGUID, size);
|
||||
}
|
||||
|
||||
void put(size_t pos, const uint8 *src, size_t cnt)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9615"
|
||||
#define REVISION_NR "9616"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue