summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-12 21:47:36 +0100
committerLennart Poettering <lennart@poettering.net>2013-02-13 00:56:13 +0100
commit641906e9366891e0ad3e6e38b7396a427678c4cf (patch)
tree47f90e01b79c50ab0839f0a0a10a8fae81dd9a25 /src/login
parent8d6167101696a28b7ac61b48fd2c1920564c4e90 (diff)
use strneq instead of strncmp
Diffstat (limited to 'src/login')
-rw-r--r--src/login/logind-inhibit.c14
-rw-r--r--src/login/sd-login.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index f1b9cca834..2c1a412e55 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -439,19 +439,19 @@ InhibitWhat inhibit_what_from_string(const char *s) {
size_t l;
FOREACH_WORD_SEPARATOR(w, l, s, ":", state) {
- if (l == 8 && strncmp(w, "shutdown", l) == 0)
+ if (l == 8 && strneq(w, "shutdown", l))
what |= INHIBIT_SHUTDOWN;
- else if (l == 5 && strncmp(w, "sleep", l) == 0)
+ else if (l == 5 && strneq(w, "sleep", l))
what |= INHIBIT_SLEEP;
- else if (l == 4 && strncmp(w, "idle", l) == 0)
+ else if (l == 4 && strneq(w, "idle", l))
what |= INHIBIT_IDLE;
- else if (l == 16 && strncmp(w, "handle-power-key", l) == 0)
+ else if (l == 16 && strneq(w, "handle-power-key", l))
what |= INHIBIT_HANDLE_POWER_KEY;
- else if (l == 18 && strncmp(w, "handle-suspend-key", l) == 0)
+ else if (l == 18 && strneq(w, "handle-suspend-key", l))
what |= INHIBIT_HANDLE_SUSPEND_KEY;
- else if (l == 20 && strncmp(w, "handle-hibernate-key", l) == 0)
+ else if (l == 20 && strneq(w, "handle-hibernate-key", l))
what |= INHIBIT_HANDLE_HIBERNATE_KEY;
- else if (l == 17 && strncmp(w, "handle-lid-switch", l) == 0)
+ else if (l == 17 && strneq(w, "handle-lid-switch", l))
what |= INHIBIT_HANDLE_LID_SWITCH;
else
return _INHIBIT_WHAT_INVALID;
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 4bc51e71a2..b81dddf86b 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -196,7 +196,7 @@ _public_ int sd_uid_is_on_seat(uid_t uid, int require_active, const char *seat)
}
FOREACH_WORD(w, l, s, state) {
- if (strncmp(t, w, l) == 0) {
+ if (strneq(t, w, l)) {
free(s);
free(t);