mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
trace: ensure messages are \0 terminated
This commit is contained in:
parent
5cc2e6af79
commit
43c9eb2791
1 changed files with 3 additions and 2 deletions
|
@ -105,7 +105,7 @@ gint _gst_trace_on = 1;
|
||||||
* @filename: a filename
|
* @filename: a filename
|
||||||
* @size: the max size of the file
|
* @size: the max size of the file
|
||||||
*
|
*
|
||||||
* Create a ringbuffer of @size in the file with @filename to
|
* Create a ringbuffer of @size in the file with @filename to
|
||||||
* store trace results in.
|
* store trace results in.
|
||||||
*
|
*
|
||||||
* Free-function: gst_trace_destroy
|
* Free-function: gst_trace_destroy
|
||||||
|
@ -183,7 +183,7 @@ gst_trace_flush (GstTrace * trace)
|
||||||
* gst_trace_text_flush:
|
* gst_trace_text_flush:
|
||||||
* @trace: the #GstTrace to flush.
|
* @trace: the #GstTrace to flush.
|
||||||
*
|
*
|
||||||
* Flush any pending trace entries in @trace to the trace file,
|
* Flush any pending trace entries in @trace to the trace file,
|
||||||
* formatted as a text line with timestamp and sequence numbers.
|
* formatted as a text line with timestamp and sequence numbers.
|
||||||
* @trace can be NULL in which case the default #GstTrace will be
|
* @trace can be NULL in which case the default #GstTrace will be
|
||||||
* flushed.
|
* flushed.
|
||||||
|
@ -241,6 +241,7 @@ _gst_trace_add_entry (GstTrace * trace, guint32 seq, guint32 data, gchar * msg)
|
||||||
entry->sequence = seq;
|
entry->sequence = seq;
|
||||||
entry->data = data;
|
entry->data = data;
|
||||||
strncpy (entry->message, msg, 112);
|
strncpy (entry->message, msg, 112);
|
||||||
|
entry->message[111] = '\0';
|
||||||
trace->bufoffset++;
|
trace->bufoffset++;
|
||||||
|
|
||||||
gst_trace_flush (trace);
|
gst_trace_flush (trace);
|
||||||
|
|
Loading…
Reference in a new issue