summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-05 20:01:22 +0100
committerThomas Haller <thaller@redhat.com>2018-03-06 10:39:15 +0100
commit34888f08f51e81493d46d043e612ab8a5e298261 (patch)
tree1b87710b82c8b1b2b662b33b39dab3e49b7874d3
parent78df61a9e25a7b0aff2aeb1e7449d84aa5572513 (diff)
downloadnetwork-manager-applet-34888f08f51e81493d46d043e612ab8a5e298261.tar.gz
libnma/cert-chooser: allow optional @scheme output argument in uri_to_value_with_scheme()
The callers don't assert with "g_return_val_if_fail(scheme)" that the user provided a non-NULL output argument. In general, be more forgiving and require less. Accept a missing output scheme.
-rw-r--r--src/libnma/nma-cert-chooser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnma/nma-cert-chooser.c b/src/libnma/nma-cert-chooser.c
index fa5c0d0e..de69d58a 100644
--- a/src/libnma/nma-cert-chooser.c
+++ b/src/libnma/nma-cert-chooser.c
@@ -100,18 +100,18 @@ static gchar *
uri_to_value_with_scheme (const gchar *uri, NMSetting8021xCKScheme *scheme)
{
if (!uri) {
- *scheme = NM_SETTING_802_1X_CK_SCHEME_UNKNOWN;
+ NM_SET_OUT (scheme, NM_SETTING_802_1X_CK_SCHEME_UNKNOWN);
return NULL;
}
if (g_str_has_prefix (uri, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) {
- *scheme = NM_SETTING_802_1X_CK_SCHEME_PATH;
+ NM_SET_OUT (scheme, NM_SETTING_802_1X_CK_SCHEME_PATH);
return g_uri_unescape_string (uri + NM_STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH), NULL);
}
#if LIBNM_BUILD
if (g_str_has_prefix (uri, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PKCS11)) {
- *scheme = NM_SETTING_802_1X_CK_SCHEME_PKCS11;
+ NM_SET_OUT (scheme, NM_SETTING_802_1X_CK_SCHEME_PKCS11);
return g_strdup (uri);
}
#endif