diff --git a/interfaces/innerkits/nativetoken/include/nativetoken.h b/interfaces/innerkits/nativetoken/include/nativetoken.h index dc71d3888e53901c094f0b34747fc38c60d15294..e67f116be1c9b0aa4e3c66e4a6e10d69b855e908 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken.h @@ -95,7 +95,7 @@ typedef struct TokenList { } NativeTokenList; typedef struct StrArrayAttribute { - int32_t maxStrNum; + uint32_t maxStrNum; uint32_t maxStrLen; const char *strKey; } StrArrayAttr; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 7921b36cea88008651fa5a11f3d7f25ea0021c61..aac4de154c5f1a1cdc75da2c00e18bab679c10ce 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -76,7 +76,7 @@ uint32_t GetAplFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode) uint32_t GetInfoArrFromJson(cJSON *cjsonItem, char *strArr[], int32_t *strNum, StrArrayAttr *attr) { cJSON *strArrJson = cJSON_GetObjectItem(cjsonItem, attr->strKey); - int32_t size = cJSON_GetArraySize(strArrJson); + uint32_t size = (uint32_t)cJSON_GetArraySize(strArrJson); if (size > attr->maxStrNum) { AT_LOG_ERROR("[ATLIB-%s]:size = %d is invalid.", __func__, size); return ATRET_FAILED;