Chore: use ffStrCopyN instead of strlcpy

This commit is contained in:
李通洲
2024-10-17 22:29:38 +08:00
parent 9bd692dffb
commit 48bb5b8746
7 changed files with 29 additions and 17 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ static void detectChoco(FF_MAYBE_UNUSED FFPackagesResult* result)
return;
char chocoPath[MAX_PATH + 3];
strcpy(chocoPath, chocoInstall);
strncat(chocoPath, "/lib/*", sizeof(chocoPath) - 1 - strlen(chocoPath));
char* pend = ffStrCopyN(chocoPath, chocoInstall, sizeof(chocoPath));
ffStrCopyN(pend, "/lib/*", sizeof(chocoPath) - (pend - chocoPath));
result->choco = getNumElements(chocoPath, FILE_ATTRIBUTE_DIRECTORY, "choco");
}