[gvfs/wip/inigomartinez/meson] afp: Prevent usage of uninitialized variable
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/inigomartinez/meson] afp: Prevent usage of uninitialized variable
- Date: Wed, 27 Sep 2017 10:54:01 +0000 (UTC)
commit ab316f25b96b6bac311b3e56c255fdc9776f280d
Author: Ondrej Holy <oholy redhat com>
Date: Thu Sep 21 19:28:22 2017 +0200
afp: Prevent usage of uninitialized variable
More warnings are printed when building thanks to meson port. The code
contains goto command which skips initialization of server_name variable.
Let's move the initialization to another place in order to prevent usage
of uninitialized variable and the following warning:
warning: ‘server_name’ may be used uninitialized in this function
https://bugzilla.gnome.org/show_bug.cgi?id=786149
daemon/gvfsafpserver.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index 4864560..c115352 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -1015,6 +1015,9 @@ g_vfs_afp_server_login (GVfsAfpServer *server,
if (!res)
return FALSE;
+ /* Use utf8_server_name if it exists */
+ server_name = priv->info.utf8_server_name ? priv->info.utf8_server_name : priv->info.server_name;
+
olduser = g_strdup (initial_user);
if (initial_user)
@@ -1046,9 +1049,6 @@ g_vfs_afp_server_login (GVfsAfpServer *server,
}
}
- /* Use utf8_server_name if it exists */
- server_name = priv->info.utf8_server_name ? priv->info.utf8_server_name : priv->info.server_name;
-
while (TRUE)
{
GString *str;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]