[network-manager-applet] libnma/cert-chooser: allow optional @scheme output argument in uri_to_value_with_scheme()
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] libnma/cert-chooser: allow optional @scheme output argument in uri_to_value_with_scheme()
- Date: Tue, 6 Mar 2018 10:23:40 +0000 (UTC)
commit 34888f08f51e81493d46d043e612ab8a5e298261
Author: Thomas Haller <thaller redhat com>
Date: Mon Mar 5 20:01:22 2018 +0100
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.
src/libnma/nma-cert-chooser.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libnma/nma-cert-chooser.c b/src/libnma/nma-cert-chooser.c
index fa5c0d0..de69d58 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]