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:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user