mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
+4
-5
@@ -161,7 +161,8 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath)
|
||||
FREE_CONTEXT_OUT_RPCID_ENCODE, -1);
|
||||
}
|
||||
|
||||
if (cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr) < 0) {
|
||||
ret = cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr);
|
||||
if (ret < 0) {
|
||||
PRINT_ERR("get \"syscap\" array size failed\n");
|
||||
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, NULL, contextBuffer,
|
||||
FREE_CONTEXT_OUT_RPCID_ENCODE, -1);
|
||||
@@ -179,13 +180,11 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath)
|
||||
}
|
||||
(void) memset_s(convertedBuffer, convertedBufLen, 0, convertedBufLen);
|
||||
|
||||
ret = FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret);
|
||||
if (ret == -1) {
|
||||
if (FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret) == -1) {
|
||||
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,
|
||||
FREE_CONVERT_OUT_RPCID_ENCODE, ret);
|
||||
}
|
||||
ret = ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen);
|
||||
if (ret != 0) {
|
||||
if (ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen) != 0) {
|
||||
PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath);
|
||||
}
|
||||
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,
|
||||
|
||||
Reference in New Issue
Block a user