mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fixed type
This commit is contained in:
parent
b9ccd28428
commit
e0f68bedc1
1 changed files with 7 additions and 7 deletions
|
@ -331,19 +331,19 @@ int JurisdictionMap::unpackFromMessage(unsigned char* sourceBuffer, int availabl
|
||||||
// increment to push past the packet header
|
// increment to push past the packet header
|
||||||
int numBytesPacketHeader = numBytesForPacketHeader(sourceBuffer);
|
int numBytesPacketHeader = numBytesForPacketHeader(sourceBuffer);
|
||||||
sourceBuffer += numBytesPacketHeader;
|
sourceBuffer += numBytesPacketHeader;
|
||||||
int remaingingBytes = availableBytes - numBytesPacketHeader;
|
int remainingBytes = availableBytes - numBytesPacketHeader;
|
||||||
|
|
||||||
// read the root jurisdiction
|
// read the root jurisdiction
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
memcpy(&bytes, sourceBuffer, sizeof(bytes));
|
memcpy(&bytes, sourceBuffer, sizeof(bytes));
|
||||||
sourceBuffer += sizeof(bytes);
|
sourceBuffer += sizeof(bytes);
|
||||||
remaingingBytes -= sizeof(bytes);
|
remainingBytes -= sizeof(bytes);
|
||||||
|
|
||||||
if (bytes > 0 && bytes <= remaingingBytes) {
|
if (bytes > 0 && bytes <= remainingBytes) {
|
||||||
_rootOctalCode = new unsigned char[bytes];
|
_rootOctalCode = new unsigned char[bytes];
|
||||||
memcpy(_rootOctalCode, sourceBuffer, bytes);
|
memcpy(_rootOctalCode, sourceBuffer, bytes);
|
||||||
sourceBuffer += bytes;
|
sourceBuffer += bytes;
|
||||||
remaingingBytes -= bytes;
|
remainingBytes -= bytes;
|
||||||
|
|
||||||
// if and only if there's a root jurisdiction, also include the end nodes
|
// if and only if there's a root jurisdiction, also include the end nodes
|
||||||
int endNodeCount = 0;
|
int endNodeCount = 0;
|
||||||
|
@ -353,13 +353,13 @@ int JurisdictionMap::unpackFromMessage(unsigned char* sourceBuffer, int availabl
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
memcpy(&bytes, sourceBuffer, sizeof(bytes));
|
memcpy(&bytes, sourceBuffer, sizeof(bytes));
|
||||||
sourceBuffer += sizeof(bytes);
|
sourceBuffer += sizeof(bytes);
|
||||||
remaingingBytes -= sizeof(bytes);
|
remainingBytes -= sizeof(bytes);
|
||||||
|
|
||||||
if (bytes <= remaingingBytes) {
|
if (bytes <= remainingBytes) {
|
||||||
unsigned char* endNodeCode = new unsigned char[bytes];
|
unsigned char* endNodeCode = new unsigned char[bytes];
|
||||||
memcpy(endNodeCode, sourceBuffer, bytes);
|
memcpy(endNodeCode, sourceBuffer, bytes);
|
||||||
sourceBuffer += bytes;
|
sourceBuffer += bytes;
|
||||||
remaingingBytes -= bytes;
|
remainingBytes -= bytes;
|
||||||
|
|
||||||
// if the endNodeCode was 0 length then don't add it
|
// if the endNodeCode was 0 length then don't add it
|
||||||
if (bytes > 0) {
|
if (bytes > 0) {
|
||||||
|
|
Loading…
Reference in a new issue