Fix "no remove aqua speed" bug when player leaves the water
[ryzomcore.git] / nel / 3rdparty / seven_zip / 7zBuf.c
blob8865c32a81b00e4717330b31c6451097a521660c
1 /* 7zBuf.c -- Byte Buffer
2 2017-04-03 : Igor Pavlov : Public domain */
4 #include "Precomp.h"
6 #include "7zBuf.h"
8 void Buf_Init(CBuf *p)
10 p->data = 0;
11 p->size = 0;
14 int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc)
16 p->size = 0;
17 if (size == 0)
19 p->data = 0;
20 return 1;
22 p->data = (Byte *)ISzAlloc_Alloc(alloc, size);
23 if (p->data)
25 p->size = size;
26 return 1;
28 return 0;
31 void Buf_Free(CBuf *p, ISzAllocPtr alloc)
33 ISzAlloc_Free(alloc, p->data);
34 p->data = 0;
35 p->size = 0;