diff options
author | Timm Bäder <mail@baedert.org> | 2021-01-06 17:36:32 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2021-01-06 17:36:32 +0100 |
commit | c983ded09fcafac172d518e073ef73b66a9e53cc (patch) | |
tree | 3d54b88a59fc787eb35c1d34549b2c9612824e52 | |
parent | 8a5cc02142268d9e5b6c48a1d9e53d15e8f50f47 (diff) | |
download | glib-wip/baedert/gparam.tar.gz |
glocalfile: Fix an uninitialized variablewip/baedert/gparam
Clang says:
../gio/glocalfile.c:2090:11: warning: variable 'success' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (trashdir == NULL)
^~~~~~~~~~~~~~~~
../gio/glocalfile.c:2133:12: note: uninitialized use occurs here
if (!success)
^~~~~~~
../gio/glocalfile.c:2090:7: note: remove the 'if' if its condition is always true
if (trashdir == NULL)
^~~~~~~~~~~~~~~~~~~~~
../gio/glocalfile.c:2041:23: note: initialize the variable 'success' to silence this warning
gboolean success;
^
= 0
So just do that.
-rw-r--r-- | gio/glocalfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gio/glocalfile.c b/gio/glocalfile.c index f9603e053..d3d68eca9 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -2038,7 +2038,7 @@ g_local_file_trash (GFile *file, { uid_t uid; char uid_str[32]; - gboolean success; + gboolean success = FALSE; uid = geteuid (); g_snprintf (uid_str, sizeof (uid_str), "%lu", (unsigned long)uid); |