Fixed buffer allocation
This commit is contained in:
parent
02b593c237
commit
1b005488a2
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ void buffer::write(char *data_in, int data_size)
|
|||
{
|
||||
if (data_size > allocated - size)
|
||||
{
|
||||
allocated = allocated + (allocated - (size + data_size)) + BUFFER_SIZE;
|
||||
allocated += (size + data_size) + BUFFER_SIZE;
|
||||
data = (char *)realloc(data, allocated);
|
||||
if (!data)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue