summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-14 19:58:33 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-14 19:59:10 +0100
commitf90cf44c02ac09469279126e2863a1e71358ee11 (patch)
tree088d05e846f60a9bbe0e3e60bb694bcff1cf2dcb /src/load-fragment.c
parent5475ff4b7ad8b95d9863c98f0930a6c9b5c80eed (diff)
load-fragment: properly do comparison of words
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 424e6c37bb..9b39d9161a 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -433,7 +433,7 @@ static int config_parse_exec(
k = 0;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (strncmp(w, ";", l) == 0)
+ if (strncmp(w, ";", MAX(l, 1U)) == 0)
break;
k++;
@@ -444,7 +444,7 @@ static int config_parse_exec(
k = 0;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (strncmp(w, ";", l) == 0)
+ if (strncmp(w, ";", MAX(l, 1U)) == 0)
break;
if (honour_argv0 && w == rvalue) {
@@ -1077,11 +1077,11 @@ static int config_parse_mount_flags(
assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (strncmp(w, "shared", l) == 0)
+ if (strncmp(w, "shared", MAX(l, 6U)) == 0)
flags |= MS_SHARED;
- else if (strncmp(w, "slave", l) == 0)
+ else if (strncmp(w, "slave", MAX(l, 5U)) == 0)
flags |= MS_SLAVE;
- else if (strncmp(w, "private", l) == 0)
+ else if (strncmp(w, "private", MAX(l, 7U)) == 0)
flags |= MS_PRIVATE;
else {
log_error("[%s:%u] Failed to parse mount flags, ignoring: %s", filename, line, rvalue);