From dcc408bf30d94faf68ec6ff16e40dce63c792897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E7=A3=8A?= Date: Sun, 30 Jan 2022 08:17:17 +0000 Subject: [PATCH] update services/init/init_service_manager.c. Signed-off-by: xionglei --- services/init/init_service_manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index 19c1cbbd..7314c1f9 100755 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -232,7 +232,7 @@ void ReleaseService(Service *service) static char *GetStringValue(const cJSON *json, const char *name, size_t *strLen) { char *fieldStr = cJSON_GetStringValue(cJSON_GetObjectItem(json, name)); - INIT_ERROR_CHECK(fieldStr != NULL, return NULL, "Failed to get string for %s", name); + INIT_CHECK(fieldStr != NULL, return NULL); *strLen = strlen(fieldStr); return fieldStr; } @@ -242,8 +242,8 @@ static int GetStringItem(const cJSON *json, const char *name, char *buffer, int INIT_ERROR_CHECK(json != NULL, return SERVICE_FAILURE, "Invalid json for %s", name); size_t strLen = 0; char *fieldStr = GetStringValue(json, name, &strLen); - INIT_ERROR_CHECK((fieldStr != NULL) && (strLen != 0) && (strLen <= (size_t)buffLen), - return SERVICE_FAILURE, "Invalid str filed %s for %s", fieldStr, name); + INIT_CHECK((fieldStr != NULL) && (strLen != 0) && (strLen <= (size_t)buffLen), + return SERVICE_FAILURE); return strcpy_s(buffer, buffLen, fieldStr); } -- GitLab