summaryrefslogtreecommitdiff
path: root/libnm
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-03-16 21:21:43 +0100
committerThomas Haller <thaller@redhat.com>2019-03-25 09:12:32 +0100
commit395738900fd4de294696dd0a4a882f42a5e9943e (patch)
treeefcb87a439ba4dac1ea44d61933e7bed1bf4c38f /libnm
parent731d251cc08f5f5d01526cf220f61963f1c43fa7 (diff)
downloadNetworkManager-395738900fd4de294696dd0a4a882f42a5e9943e.tar.gz
libnm: don't use strlen() for checking for non-empty string
It's well understood that these are NUL terminated strings. We don't need strlen() to check that the strings aren't empty.
Diffstat (limited to 'libnm')
-rw-r--r--libnm/nm-secret-agent-old.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c
index 56a88b004f..40485ab6c0 100644
--- a/libnm/nm-secret-agent-old.c
+++ b/libnm/nm-secret-agent-old.c
@@ -892,8 +892,7 @@ nm_secret_agent_old_get_secrets (NMSecretAgentOld *self,
g_return_if_fail (NM_IS_SECRET_AGENT_OLD (self));
g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection));
- g_return_if_fail (setting_name != NULL);
- g_return_if_fail (strlen (setting_name) > 0);
+ g_return_if_fail (setting_name && setting_name[0]);
g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM));
g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS));
g_return_if_fail (callback != NULL);