ensure: Fix potential off by one error.

This commit is contained in:
Max Bruckner 2017-03-23 21:27:54 +01:00
parent e58f7ec027
commit cc84a446be

View File

@ -259,7 +259,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed, const interna
return NULL;
}
needed += p->offset;
needed += p->offset + 1;
if (needed <= p->length)
{
return p->buffer + p->offset;