diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index b667de754c0faa41e3ec97a3cdc3dcb826f4ecc3..26c14991cd4529099c95136351be93dc356d2cec 100755 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -1006,7 +1006,7 @@ void ParseAllServices(const cJSON *fileRoot) if (service == NULL) { INIT_LOGE("Failed to add service name %s", fieldStr); continue; - } + } } else { INIT_LOGI("Service %s already exists, updating.", fieldStr); #ifndef __MUSL__ diff --git a/services/modules/reboot/reboot_static.c b/services/modules/reboot/reboot_static.c index 70ddb34dff5cc47855690c3d0896a3fa89f58041..97d41b977151b1dd1f75c31509072a337cdec03c 100644 --- a/services/modules/reboot/reboot_static.c +++ b/services/modules/reboot/reboot_static.c @@ -128,7 +128,8 @@ static int AddRebootCmdExecutor_(const char *cmd, CmdExecutor executor) } g_rebootParamCmdInfos = cmdInfos; } - PLUGIN_CHECK(g_rebootParamCmdValidNumber < g_rebootParamCmdMaxNumber, return -1, "Param cmd number exceed limit"); + PLUGIN_CHECK(g_rebootParamCmdValidNumber >= 0 && g_rebootParamCmdValidNumber < g_rebootParamCmdMaxNumber, + return -1, "Param cmd number exceed limit"); return SetParamCmdInfo(&g_rebootParamCmdInfos[g_rebootParamCmdValidNumber], executor, cmd); }