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, 18 Feb 2020 16:12:14 +0000 (11:12 -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 1ccbffd67fe60a961de18cf6b4c58d7334d1c155..a4160f1c7106298c7d11e6f31681a773c9c4c839 100644 (file)
@@ -2517,7 +2517,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.027006 seconds and 4 git commands to generate.