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:
Seungha Yang 2020-06-24 22:51:48 +09:00 committed by Tim-Philipp Müller
parent b935ac6642
commit 6b8bb822e4

View file

@ -132,6 +132,7 @@ n_print (const char *format, ...)
{
va_list args;
int i;
gchar *str;
if (_name)
g_print ("%s", _name);
@ -140,8 +141,14 @@ n_print (const char *format, ...)
g_print (" ");
va_start (args, format);
g_vprintf (format, args);
str = gst_info_strdup_vprintf (format, args);
va_end (args);
if (!str)
return;
g_print ("%s", str);
g_free (str);
}
static gboolean