mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[raknet] Match AllocPacket(...)
This commit is contained in:
parent
edc7c6a9a0
commit
dcfcaab9b0
@ -143,9 +143,18 @@ Packet *AllocPacket(unsigned dataSize)
|
||||
Packet *AllocPacket(unsigned dataSize, unsigned char *data)
|
||||
{
|
||||
Packet *p = (Packet *)malloc(sizeof(Packet));
|
||||
p->data=NULL;
|
||||
p->length=0;
|
||||
p->deleteData=false;
|
||||
if(dataSize != 0)
|
||||
{
|
||||
if(data != NULL)
|
||||
{
|
||||
p->data=data;
|
||||
p->length=dataSize;
|
||||
p->deleteData=true;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user