mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pw-dump: handle 0 size string
This commit is contained in:
parent
69ea147a29
commit
cc31412ef3
1 changed files with 2 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ static void object_destroy(struct object *o)
|
|||
|
||||
static void put_key(struct data *d, const char *key)
|
||||
{
|
||||
int size = strlen(key) * 4;
|
||||
int size = (strlen(key) + 1) * 4;
|
||||
char *str = alloca(size);
|
||||
spa_json_encode_string(str, size, key);
|
||||
fprintf(d->out, "%s%s%*s%s%s%s:",
|
||||
|
|
@ -255,7 +255,7 @@ static SPA_PRINTF_FUNC(3,4) void put_fmt(struct data *d, const char *key, const
|
|||
|
||||
static void put_string(struct data *d, const char *key, const char *val)
|
||||
{
|
||||
int size = strlen(val) * 4;
|
||||
int size = (strlen(val) + 1) * 4;
|
||||
char *str = alloca(size);
|
||||
spa_json_encode_string(str, size, val);
|
||||
put_fmt(d, key, "%s%s%s", STRING, str, NORMAL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue