mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-06-09 17:48:19 +02:00
spa-json: encode string in wp_spa_json_new_string()
This commit is contained in:
parent
0996f5a5ca
commit
b6e8e7e064
1 changed files with 4 additions and 1 deletions
|
|
@ -388,8 +388,11 @@ wp_spa_json_new_float (float value)
|
|||
WpSpaJson *
|
||||
wp_spa_json_new_string (const gchar *value)
|
||||
{
|
||||
size_t size = (strlen (value) * 4) + 2;
|
||||
gchar dst[size];
|
||||
spa_json_encode_string (dst, sizeof(dst), value);
|
||||
return wp_spa_json_new_from_builder (
|
||||
wp_spa_json_builder_new_formatted ("\"%s\"", value));
|
||||
wp_spa_json_builder_new_formatted ("%s", dst));
|
||||
}
|
||||
|
||||
/* Args is not a pointer in some architectures, so this needs to be a macro to
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue