test-utils: Fix compiler warning

This fixes the following compiler warning:

In file included from /usr/include/glib-2.0/glib.h:114,
                 from ../src/tests/test-utils.h:23,
                 from ../src/tests/test-utils.c:22:
../src/tests/test-utils.c: In function ‘test_init’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘basename’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   28 |   g_free (*pp);
      |   ^~~~~~~~~~~~
../src/tests/test-utils.c:73:24: note: ‘basename’ was declared here
   73 |       g_autofree char *basename;
      |                        ^~~~~~~~

https://gitlab.gnome.org/GNOME/mutter/merge_requests/627
This commit is contained in:
Hans de Goede 2019-06-19 12:54:02 +02:00
parent f2020913fd
commit 446e82e86d

View File

@ -70,7 +70,7 @@ ensure_test_client_path (int argc,
if (!g_file_test (test_client_path,
G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE))
{
g_autofree char *basename;
g_autofree char *basename = NULL;
g_autofree char *dirname = NULL;
basename = g_path_get_basename (argv[0]);