mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
spa: spa_strbuf_init should null-terminate
This commit is contained in:
parent
8f66df2f78
commit
d099ceaff1
1 changed files with 2 additions and 0 deletions
|
|
@ -367,6 +367,8 @@ static inline void spa_strbuf_init(struct spa_strbuf *buf, char *buffer, size_t
|
||||||
buf->buffer = buffer;
|
buf->buffer = buffer;
|
||||||
buf->maxsize = maxsize;
|
buf->maxsize = maxsize;
|
||||||
buf->pos = 0;
|
buf->pos = 0;
|
||||||
|
if (maxsize > 0)
|
||||||
|
buf->buffer[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
SPA_PRINTF_FUNC(2, 3)
|
SPA_PRINTF_FUNC(2, 3)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue