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:
@@ -44,7 +44,7 @@
|
||||
#if HAVE_ACL
|
||||
|
||||
static int get_acl(int fd, const char *name, acl_type_t type, acl_t *ret) {
|
||||
char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
|
||||
char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
|
||||
acl_t acl;
|
||||
|
||||
assert(fd >= 0);
|
||||
@@ -73,7 +73,7 @@ static int get_acl(int fd, const char *name, acl_type_t type, acl_t *ret) {
|
||||
}
|
||||
|
||||
static int set_acl(int fd, const char *name, acl_type_t type, acl_t acl) {
|
||||
char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
|
||||
char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
|
||||
int r;
|
||||
|
||||
assert(fd >= 0);
|
||||
|
||||
+2
-2
@@ -2856,7 +2856,7 @@ static int uid_shift_pick(uid_t *shift, LockFile *ret_lock_file) {
|
||||
(void) mkdir("/run/systemd/nspawn-uid", 0755);
|
||||
|
||||
for (;;) {
|
||||
char lock_path[strlen("/run/systemd/nspawn-uid/") + DECIMAL_STR_MAX(uid_t) + 1];
|
||||
char lock_path[STRLEN("/run/systemd/nspawn-uid/") + DECIMAL_STR_MAX(uid_t) + 1];
|
||||
_cleanup_release_lock_file_ LockFile lf = LOCK_FILE_INIT;
|
||||
|
||||
if (--n_tries <= 0)
|
||||
@@ -2910,7 +2910,7 @@ static int uid_shift_pick(uid_t *shift, LockFile *ret_lock_file) {
|
||||
}
|
||||
|
||||
static int setup_uid_map(pid_t pid) {
|
||||
char uid_map[strlen("/proc//uid_map") + DECIMAL_STR_MAX(uid_t) + 1], line[DECIMAL_STR_MAX(uid_t)*3+3+1];
|
||||
char uid_map[STRLEN("/proc//uid_map") + DECIMAL_STR_MAX(uid_t) + 1], line[DECIMAL_STR_MAX(uid_t)*3+3+1];
|
||||
int r;
|
||||
|
||||
assert(pid > 1);
|
||||
|
||||
Reference in New Issue
Block a user