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
+4 -2
View File
@@ -252,11 +252,13 @@ int ask_password_tty(
}
if (colors_enabled())
loop_write(ttyfd, ANSI_HIGHLIGHT, strlen(ANSI_HIGHLIGHT), false);
loop_write(ttyfd, ANSI_HIGHLIGHT,
STRLEN(ANSI_HIGHLIGHT), false);
loop_write(ttyfd, message, strlen(message), false);
loop_write(ttyfd, " ", 1, false);
if (colors_enabled())
loop_write(ttyfd, ANSI_NORMAL, strlen(ANSI_NORMAL), false);
loop_write(ttyfd, ANSI_NORMAL, STRLEN(ANSI_NORMAL),
false);
new_termios = old_termios;
new_termios.c_lflag &= ~(ICANON|ECHO);
+1 -1
View File
@@ -1186,7 +1186,7 @@ int root_hash_load(const char *image, void **ret, size_t *ret_size) {
if (!IN_SET(r, -ENODATA, -EOPNOTSUPP, -ENOENT))
return r;
fn = newa(char, strlen(image) + strlen(".roothash") + 1);
fn = newa(char, strlen(image) + STRLEN(".roothash") + 1);
n = stpcpy(fn, image);
e = endswith(fn, ".raw");
if (e)
+3 -1
View File
@@ -506,7 +506,9 @@ static int output_verbose(
else {
_cleanup_free_ char *value = NULL;
r = parse_field(data, length, "_SOURCE_REALTIME_TIMESTAMP=", strlen("_SOURCE_REALTIME_TIMESTAMP="), &value, NULL);
r = parse_field(data, length, "_SOURCE_REALTIME_TIMESTAMP=",
STRLEN("_SOURCE_REALTIME_TIMESTAMP="), &value,
NULL);
if (r < 0)
return r;
assert(r > 0);
+1 -1
View File
@@ -425,7 +425,7 @@ int utmp_wall(
if (u->ut_type != USER_PROCESS || u->ut_user[0] == 0)
continue;
/* this access is fine, because strlen("/dev/") << 32 (UT_LINESIZE) */
/* this access is fine, because STRLEN("/dev/") << 32 (UT_LINESIZE) */
if (path_startswith(u->ut_line, "/dev/"))
path = u->ut_line;
else {