Use correct pointer arithmetic in OnLevelData (#3094)
Previously was incrementing the pointer 5 places due to the way pointers to complete objects are handled. see https://en.cppreference.com/w/cpp/language/operator_arithmetic#Additive_operators
This commit is contained in:
parent
2c8d29b10d
commit
e0aafcaf7d
1 changed files with 1 additions and 1 deletions
|
|
@ -366,7 +366,7 @@ DWORD OnLevelData(int pnum, const TCmd *pCmd)
|
|||
}
|
||||
|
||||
assert(message.wOffset == sgdwRecvOffset);
|
||||
memcpy(&sgRecvBuf[message.wOffset], &message + sizeof(message), message.wBytes);
|
||||
memcpy(&sgRecvBuf[message.wOffset], &message + 1, message.wBytes);
|
||||
sgdwRecvOffset += message.wBytes;
|
||||
return message.wBytes + sizeof(message);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue