Archived
1
0
Fork 0

buffer.c: fix 'off-by-one' error in 'buffer_cstr()'

This commit is contained in:
Henrik Hautakoski 2012-08-09 16:13:49 +02:00
parent 107aae0105
commit 484dadc916

View file

@ -52,7 +52,7 @@ void buffer_expand(struct buffer *b, size_t len) {
char* buffer_cstr(struct buffer *b) {
buffer_expand(b, 1);
b->block[b->len + 1] = '\0';
b->block[b->len] = '\0';
return (char*) b->block;
}