diff --git a/services/init/init_capability.c b/services/init/init_capability.c index 17e002425365e35ed1e2d66da49235bf20ef16eb..26b9792b517a214bef43279f5599fb942d638691 100644 --- a/services/init/init_capability.c +++ b/services/init/init_capability.c @@ -75,9 +75,9 @@ static unsigned int GetCapByString(const char *capStr) { "PERFMON", CAP_PERFMON }, #endif }; - int mapSize = (int)ARRAY_LENGTH(capStrCapNum); - int capLen = strlen("CAP_"); - for (int j = 0; j < mapSize; j++) { + int mapSize =(int)ARRAY_LENGTH(capStrCapNum); + int capLen=strlen("CAP_"); + for (int j = 0; j < mapSize; j++){ if ((strcmp(capStr, capStrCapNum[j].capStr) == 0) || ((strncmp(capStr, "CAP_", capLen) == 0) && (strcmp(capStr + capLen, capStrCapNum[j].capStr) == 0))) { @@ -130,4 +130,4 @@ int InitServiceCaps(const cJSON *curArrItem, Service *service) service->servPerm.capsCnt++; } return 0; -} +} \ No newline at end of file