Fix: lttng-events.c: variable may be used uninitialized
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 4 Feb 2020 21:05:30 +0000 (16:05 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Feb 2020 15:29:34 +0000 (10:29 -0500)
Fixes the following warning:
/home/frdeso/projets/lttng/modules/lttng-events.c: In function ‘print_metadata_escaped_field’:
/home/frdeso/projets/lttng/modules/lttng-events.c:2563:5: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (ret)
           ^

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If2db5e1ad9782fb49d6d07026976d3d22f89f2ab

lttng-events.c

index 8b40defe58ed7c69ca6ed6dce6f9f4af831e2822..cc932bf61643d04095c5d198e297a153d2fbd7f7 100644 (file)
@@ -2529,7 +2529,7 @@ int64_t measure_clock_offset(void)
 static
 int print_escaped_ctf_string(struct lttng_session *session, const char *string)
 {
-       int ret;
+       int ret = 0;
        size_t i;
        char cur;
 
This page took 0.0274450000000001 seconds and 4 git commands to generate.