From d9a84af0c1e29146ce708a3f4db50b0f86865cf6 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 24 Jun 2018 18:25:56 -0400 Subject: [PATCH] src/libadacl.c: use strncat instead of strcat to appease clang-tidy. --- src/libadacl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libadacl.c b/src/libadacl.c index d2462c8..4ca60c0 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -1020,7 +1020,9 @@ int apply_default_acl(const char* path, bool recursive) { bool path_is_dots = strcmp(child, ".") == 0 || strcmp(child, "..") == 0; char dots_parent[6] = "../"; if (path_is_dots) { - parent = strcat(dots_parent, child); + /* We know that "child" contains no more than two characters here, and + using strncat to enforce that belief keeps clang-tidy happy. */ + parent = strncat(dots_parent, child, 2); } parent_fd = safe_open(parent, O_DIRECTORY | O_NOFOLLOW); -- 2.43.2