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: @Consolatis Fixes: #2313
This commit is contained in:
parent
44d1e199db
commit
7e50c60b00
1 changed files with 1 additions and 1 deletions
|
|
@ -144,7 +144,7 @@ buf_add(struct buf *s, const char *data)
|
||||||
void
|
void
|
||||||
buf_add_char(struct buf *s, char ch)
|
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++] = ch;
|
||||||
s->data[s->len] = '\0';
|
s->data[s->len] = '\0';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue