fix ServerLink::ReadShape and ServerLink::AttachShape for empty shapes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20517 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -58,10 +58,12 @@ ServerLink::ReadShape(BShape *shape)
|
|||||||
fReceiver->Read(&ptCount, sizeof(int32));
|
fReceiver->Read(&ptCount, sizeof(int32));
|
||||||
|
|
||||||
uint32 opList[opCount];
|
uint32 opList[opCount];
|
||||||
fReceiver->Read(opList, opCount * sizeof(uint32));
|
if (opCount > 0)
|
||||||
|
fReceiver->Read(opList, opCount * sizeof(uint32));
|
||||||
|
|
||||||
BPoint ptList[ptCount];
|
BPoint ptList[ptCount];
|
||||||
fReceiver->Read(ptList, ptCount * sizeof(BPoint));
|
if (ptCount > 0)
|
||||||
|
fReceiver->Read(ptList, ptCount * sizeof(BPoint));
|
||||||
|
|
||||||
shape->SetData(opCount, ptCount, opList, ptList);
|
shape->SetData(opCount, ptCount, opList, ptList);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -79,8 +81,11 @@ ServerLink::AttachShape(BShape &shape)
|
|||||||
|
|
||||||
fSender->Attach(&opCount, sizeof(int32));
|
fSender->Attach(&opCount, sizeof(int32));
|
||||||
fSender->Attach(&ptCount, sizeof(int32));
|
fSender->Attach(&ptCount, sizeof(int32));
|
||||||
fSender->Attach(opList, opCount * sizeof(uint32));
|
if (opCount > 0)
|
||||||
return fSender->Attach(ptList, ptCount * sizeof(BPoint));
|
fSender->Attach(opList, opCount * sizeof(uint32));
|
||||||
|
if (ptCount > 0)
|
||||||
|
fSender->Attach(ptList, ptCount * sizeof(BPoint));
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user