mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
buf.c: fix off by one bug in buf_add_char()
Written-by: @johanmalm
Fixes: #2313
Backported from 7e50c60b00
This commit is contained in:
parent
6fe3c97443
commit
6c05316f55
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ buf_add(struct buf *s, const char *data)
|
|||
void
|
||||
buf_add_char(struct buf *s, char ch)
|
||||
{
|
||||
buf_expand(s, s->len + 1);
|
||||
buf_expand(s, s->len + 2);
|
||||
s->data[s->len++] = ch;
|
||||
s->data[s->len] = '\0';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue