From: Michael Orlitzky Date: Sun, 24 Jun 2018 22:25:56 +0000 (-0400) Subject: src/libadacl.c: use strncat instead of strcat to appease clang-tidy. X-Git-Tag: v0.4.1~1 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=d9a84af0c1e29146ce708a3f4db50b0f86865cf6;p=apply-default-acl.git src/libadacl.c: use strncat instead of strcat to appease clang-tidy. --- 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);