mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 13:21:28 +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/544>
This commit is contained in:
parent
1206a60bac
commit
57d29e7fcd
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue