X-Git-Url: http://gitweb.michael.orlitzky.com/?p=apply-default-acl.git;a=blobdiff_plain;f=src%2Flibadacl.c;h=4ca60c0c0d972018486bc725c17752725a07ebeb;hp=d2462c816f49420aaa2a09aff1fe2c2144f466ef;hb=d9a84af0c1e29146ce708a3f4db50b0f86865cf6;hpb=8ec2f2bde7c53834a304bcdc68e84d8c7a748ca4 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);