From 8f20dc1a0669ba70f59f4b80e11fee404cd24f4b Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Mon, 27 May 2024 21:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=99=E6=80=81=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E8=A7=84=E8=8C=832=E8=A1=8C=E6=94=B9=E6=88=901?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/syscap_tool.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/syscap_tool.c b/src/syscap_tool.c index d096464..bcd09fd 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -164,8 +164,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) ret = cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr); if (ret < 0) { PRINT_ERR("get \"syscap\" array size failed\n"); - return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, - convertedBuffer, contextBuffer, FREE_CONTEXT_OUT_RPCID_ENCODE, -1); + return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer, FREE_CONTEXT_OUT_RPCID_ENCODE, -1); } sysCapSize = (uint32_t)ret; // 2, to save SysCaptype & SysCapLength @@ -174,22 +173,19 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) convertedBuffer = (char *)malloc(convertedBufLen); if (convertedBuffer == NULL) { PRINT_ERR("malloc failed\n"); - return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, - convertedBuffer, contextBuffer, FREE_CONTEXT_OUT_RPCID_ENCODE, -1); + return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer, FREE_CONTEXT_OUT_RPCID_ENCODE, -1); } (void)memset_s(convertedBuffer, convertedBufLen, 0, convertedBufLen); ret = FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret); if (ret == -1) { - return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, - convertedBuffer, contextBuffer, FREE_CONVERT_OUT_RPCID_ENCODE, ret); + return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,FREE_CONVERT_OUT_RPCID_ENCODE, ret); } ret = ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath); } - return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, - convertedBuffer, contextBuffer, FREE_CONVERT_OUT_RPCID_ENCODE, ret); + return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,FREE_CONVERT_OUT_RPCID_ENCODE, ret); } static int32_t ParseRpcidToJson(char *input, uint32_t inputLen, cJSON *rpcidJson)