The stream was reused later, so it was a dumb idea to not include the

magic in it (it was written twice then, later).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13430 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-07-05 00:57:33 +00:00
parent 749a772b97
commit b1e14283b4
+5 -2
View File
@@ -2038,8 +2038,11 @@ BMessage::_SendFlattenedMessage(void *data, int32 size, port_id port,
KMessage::Header *header = (KMessage::Header*)data;
header->targetToken = (preferred ? B_PREFERRED_TOKEN : token);
} else if (magic == kMessageMagic || magic == kMessageMagicSwapped) {
// get the header (but not the magic again)
BMemoryIO stream((uint32 *)data + 1, size - sizeof(uint32));
// get the header
BMemoryIO stream(data, size);
stream.Read(&magic, sizeof(uint32));
// "discard" the magic (we already know it anyway)
Header header;
status_t error = header.SetMagic(magic);