parts of the patch submitted in bug #113913
[platform/upstream/gstreamer.git] / gst / gsttrace.c
index 6130e7d..0c9ed79 100644 (file)
@@ -108,8 +108,8 @@ void
 gst_trace_text_flush (GstTrace * trace)
 {
   int i;
-  const int strsize = 20 + 1 + 10 + 1 + 10 + 1 + 112 + 1 + 1;
-  char str[strsize];
+#define STRSIZE (20 + 1 + 10 + 1 + 10 + 1 + 112 + 1 + 1)
+  char str[STRSIZE];
 
   if (!trace) {
     trace = _gst_trace_default;
@@ -118,12 +118,13 @@ gst_trace_text_flush (GstTrace * trace)
   }
 
   for (i = 0; i < trace->bufoffset; i++) {
-    snprintf (str, strsize, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
+    snprintf (str, STRSIZE, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
              trace->buf[i].timestamp,
              trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
     write (trace->fd, str, strlen (str));
   }
   trace->bufoffset = 0;
+#undef STRSIZE
 }
 
 void