basic/memory-util: introduce mempcpy_typesafe

This commit is contained in:
Mike Yuan
2024-09-20 08:29:35 +09:00
committed by Yu Watanabe
parent 48837c6500
commit eda6223942
7 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -2756,7 +2756,7 @@ static int mkdir_parents_rm_if_wrong_type(mode_t child_mode, const char *path) {
e = s + strcspn(s, "/");
/* Copy the path component to t so it can be a null terminated string. */
*((char*) mempcpy(t, s, e - s)) = 0;
*mempcpy_typesafe(t, s, e - s) = 0;
/* Is this the last component? If so, then check the type */
if (*e == 0)