From 22dd8d350c635fb2ccd4641d19cf43f73cae4f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 11 May 2018 11:09:37 +0200 Subject: [PATCH] Use STRLEN in two places --- src/basic/fs-util.c | 2 +- src/tmpfiles/tmpfiles.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 232a21c193..32a6efdffd 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -242,7 +242,7 @@ int fchmod_umask(int fd, mode_t m) { } int fchmod_opath(int fd, mode_t m) { - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; /* This function operates also on fd that might have been opened with * O_PATH. Indeed fchmodat() doesn't have the AT_EMPTY_PATH flag like diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 46098c215c..82cda5db20 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1307,7 +1307,7 @@ static int item_do(Item *i, int fd, const struct stat *st, fdaction_t action) { r = action(i, fd, st); if (S_ISDIR(st->st_mode)) { - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; _cleanup_closedir_ DIR *d = NULL; struct dirent *de;