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:
Jérôme Duval
2007-04-02 22:53:01 +00:00
parent e89f68e277
commit 38220fb0e5
+9 -4
View File
@@ -58,10 +58,12 @@ ServerLink::ReadShape(BShape *shape)
fReceiver->Read(&ptCount, sizeof(int32));
uint32 opList[opCount];
fReceiver->Read(opList, opCount * sizeof(uint32));
if (opCount > 0)
fReceiver->Read(opList, opCount * sizeof(uint32));
BPoint ptList[ptCount];
fReceiver->Read(ptList, ptCount * sizeof(BPoint));
if (ptCount > 0)
fReceiver->Read(ptList, ptCount * sizeof(BPoint));
shape->SetData(opCount, ptCount, opList, ptList);
return B_OK;
@@ -79,8 +81,11 @@ ServerLink::AttachShape(BShape &shape)
fSender->Attach(&opCount, sizeof(int32));
fSender->Attach(&ptCount, sizeof(int32));
fSender->Attach(opList, opCount * sizeof(uint32));
return fSender->Attach(ptList, ptCount * sizeof(BPoint));
if (opCount > 0)
fSender->Attach(opList, opCount * sizeof(uint32));
if (ptCount > 0)
fSender->Attach(ptList, ptCount * sizeof(BPoint));
return B_OK;
}