tree-wide: make use of new STRLEN() macro everywhere (#7639)

Let's employ coccinelle to do this for us.

Follow-up for #7625.
This commit is contained in:
Lennart Poettering
2017-12-14 19:02:29 +01:00
committed by GitHub
parent 1142cbd76a
commit fbd0b64f44
63 changed files with 253 additions and 219 deletions
+3 -3
View File
@@ -1474,7 +1474,7 @@ static bool valid_slice_name(const char *p, size_t n) {
if (!p)
return false;
if (n < strlen("x.slice"))
if (n < STRLEN("x.slice"))
return false;
if (memcmp(p + n - 6, ".slice", 6) == 0) {
@@ -1558,7 +1558,7 @@ static const char *skip_session(const char *p) {
p += strspn(p, "/");
n = strcspn(p, "/");
if (n < strlen("session-x.scope"))
if (n < STRLEN("session-x.scope"))
return NULL;
if (memcmp(p, "session-", 8) == 0 && memcmp(p + n - 6, ".scope", 6) == 0) {
@@ -1595,7 +1595,7 @@ static const char *skip_user_manager(const char *p) {
p += strspn(p, "/");
n = strcspn(p, "/");
if (n < strlen("user@x.service"))
if (n < STRLEN("user@x.service"))
return NULL;
if (memcmp(p, "user@", 5) == 0 && memcmp(p + n - 8, ".service", 8) == 0) {