buffer.c: fix 'off-by-one' error when indexing array.
This commit is contained in:
parent
d18d581fd0
commit
52777c2ff8
1 changed files with 1 additions and 1 deletions
2
buffer.c
2
buffer.c
|
|
@ -67,7 +67,7 @@ char* buffer_cstr_release(struct buffer *b) {
|
|||
} else {
|
||||
ret = (char *) b->block;
|
||||
}
|
||||
ret[b->len + 1] = '\0';
|
||||
ret[b->len] = '\0';
|
||||
} else {
|
||||
ret = calloc(1, 1);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue