!541 update src/create_pcid.c.

Merge pull request !541 from Mr.zhao/OpenHarmony-4.1-Release
This commit is contained in:
openharmony_ci
2025-04-09 08:56:29 +00:00
committed by Gitee
+5
View File
@@ -356,6 +356,11 @@ int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, size_t contextBufL
char *tempPriSyscapStr = priSyscapStr;
char *ptrPrivateSyscap = (char *)(pcidMain + 1);
while (*ptrPrivateSyscap != '\0') {
size_t currentLen = tempPriSyscapStr - priSyscapStr;
if (currentLen >= SINGLE_SYSCAP_LEN - 1) {
printf("Syscap name exceeds maximum length\n");
return -1;
}
if (*ptrPrivateSyscap == ',') {
*tempPriSyscapStr = '\0';
int32_t ret = sprintf_s(fullCapStr, SINGLE_SYSCAP_LEN, "SystemCapability.%s", priSyscapStr);