From 7e727e74cbd7a37bf102b1cddde73cc534a5c97a Mon Sep 17 00:00:00 2001 From: lsq Date: Wed, 11 May 2022 11:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lsq Change-Id: Ifefc21ef12bb9b86ba681cf29f8b17ed5c660c0c --- interfaces/innerkits/nativetoken/include/nativetoken.h | 2 +- interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/innerkits/nativetoken/include/nativetoken.h b/interfaces/innerkits/nativetoken/include/nativetoken.h index dc71d3888..e67f116be 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 7921b36ce..aac4de154 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; -- Gitee