From de88d8572a3456ddf1bb47908f89d27dc1e419d5 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 21 Mar 2017 20:57:02 +0100 Subject: qmicli,wds: only need to initialize enum member fields in struct When doing member initializations when the struct variable is declared, only initialize the enum fields to valid enum values, the remaining fields will be initialized to zero. This is a different approach to the fix done in 4c678418. --- src/qmicli/qmicli-wds.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c index 75d7992..fcc5b49 100644 --- a/src/qmicli/qmicli-wds.c +++ b/src/qmicli/qmicli-wds.c @@ -439,7 +439,7 @@ start_network_properties_handle (const gchar *key, return TRUE; } - if (g_ascii_strcasecmp (key, "ip-type") == 0 && props->ip_type == 0) { + if (g_ascii_strcasecmp (key, "ip-type") == 0 && props->ip_type == QMI_WDS_IP_FAMILY_UNSPECIFIED) { switch (atoi (value)) { case 4: props->ip_type = QMI_WDS_IP_FAMILY_IPV4; @@ -474,13 +474,8 @@ start_network_input_create (const gchar *str) gchar **split = NULL; QmiMessageWdsStartNetworkInput *input = NULL; StartNetworkProperties props = { - .apn = NULL, - .profile_index_3gpp = 0, - .profile_index_3gpp2 = 0, - .auth = QMI_WDS_AUTHENTICATION_NONE, - .auth_set = FALSE, - .username = NULL, - .password = NULL, + .auth = QMI_WDS_AUTHENTICATION_NONE, + .ip_type = QMI_WDS_IP_FAMILY_UNSPECIFIED, }; /* An empty string is totally valid (i.e. no TLVs) */ -- cgit v1.1