提交 24f7eeed 编写于 作者: M Miroslav Rezanina 提交者: Thomas Huth

test-logging: Fix -Werror=maybe-uninitialized warning

Checking for uninitialized variables raises warning for file path
variables in test_logfile_write and test_logfile_lock functions.

To suppress this warning, initialize varibles to NULL. This is safe
change as result of g_build_filename is stored to them before any usage.
Signed-off-by: NMiroslav Rezanina <mrezanin@redhat.com>
Message-Id: <63b0fcedf7dfe799c8210b113e5dccf32414a89d.1579598240.git.mrezanin@redhat.com>
Reviewed-by: NThomas Huth <thuth@redhat.com>
Reviewed-by: NRobert Foley <robert.foley@linaro.org>
Signed-off-by: NThomas Huth <thuth@redhat.com>
上级 f31160c7
......@@ -114,8 +114,8 @@ static void test_logfile_write(gconstpointer data)
QemuLogFile *logfile2;
gchar const *dir = data;
Error *err = NULL;
g_autofree gchar *file_path;
g_autofree gchar *file_path1;
g_autofree gchar *file_path = NULL;
g_autofree gchar *file_path1 = NULL;
FILE *orig_fd;
/*
......@@ -157,7 +157,7 @@ static void test_logfile_lock(gconstpointer data)
FILE *logfile;
gchar const *dir = data;
Error *err = NULL;
g_autofree gchar *file_path;
g_autofree gchar *file_path = NULL;
file_path = g_build_filename(dir, "qemu_test_logfile_lock0.log", NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册