mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 08:55:33 +00:00
gst-inspect: Use gst_info_strdup_vprintf to print string
g_vprintf() will write a string binary to stdout directly using fwrite(). So, depending on character in the string, fwrite to stdout can print broken one but printf family might not cause the issue. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/637>
This commit is contained in:
parent
b935ac6642
commit
6b8bb822e4
1 changed files with 8 additions and 1 deletions
|
@ -132,6 +132,7 @@ n_print (const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
int i;
|
int i;
|
||||||
|
gchar *str;
|
||||||
|
|
||||||
if (_name)
|
if (_name)
|
||||||
g_print ("%s", _name);
|
g_print ("%s", _name);
|
||||||
|
@ -140,8 +141,14 @@ n_print (const char *format, ...)
|
||||||
g_print (" ");
|
g_print (" ");
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
g_vprintf (format, args);
|
str = gst_info_strdup_vprintf (format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
|
if (!str)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_print ("%s", str);
|
||||||
|
g_free (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue