diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-28 16:25:36 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-03-03 18:54:20 +0100 |
commit | 01b9b4104c365002fae5e45b564956062fe146d4 (patch) | |
tree | de72d05b95706d94a8750d9870768b61edf8b98a /libnm-util | |
parent | 7871d850f50975b46f7909bc6bd3cce434c7c60e (diff) | |
download | NetworkManager-01b9b4104c365002fae5e45b564956062fe146d4.tar.gz |
all: clean-up usage of GError
Functions that take a GError** MUST fill it in on error. There is no
need to check whether error is NULL if the function it was passed to
had a failing return value.
Likewise, a proper GError must have a non-NULL message, so there's no
need to double-check that either.
Based-on-patch-by: Dan Winship <danw@gnome.org>
Diffstat (limited to 'libnm-util')
-rw-r--r-- | libnm-util/nm-utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 7c9def1da2..e9f20a1c77 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -1515,8 +1515,7 @@ nm_utils_uuid_generate_from_string (const char *s) if (!nm_utils_init (&error)) { g_warning ("error initializing crypto: (%d) %s", - error ? error->code : 0, - error ? error->message : "unknown"); + error->code, error->message); if (error) g_error_free (error); return NULL; @@ -1524,8 +1523,7 @@ nm_utils_uuid_generate_from_string (const char *s) if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (uuid), &error)) { g_warning ("error generating UUID: (%d) %s", - error ? error->code : 0, - error ? error->message : "unknown"); + error->code, error->message); if (error) g_error_free (error); return NULL; |