Archived
1
0
Fork 0

buffer.c: fix 'off-by-one' error in 'buffer_expand'

This commit is contained in:
Henrik Hautakoski 2012-08-09 16:23:01 +02:00
parent 484dadc916
commit ee17b5e370

View file

@ -37,7 +37,7 @@ void buffer_init(struct buffer *b) {
void buffer_expand(struct buffer *b, size_t len) { void buffer_expand(struct buffer *b, size_t len) {
if (b->len + len < b->size) if (b->len + len <= b->size)
return; return;
if (!b->size) if (!b->size)
b->block = NULL; b->block = NULL;