未验证 提交 bcd415c1 编写于 作者: O openharmony_ci 提交者: Gitee

!335 fix: 修复代码静态检查(0221)

Merge pull request !335 from 熊磊/init0221xyt
......@@ -20,6 +20,7 @@
#include "begetctl.h"
#include "sys_param.h"
#include "init_utils.h"
#define SERVICE_START_NUMBER 2
#define SERVICE_CONTROL_NUMBER 3
......@@ -52,7 +53,7 @@ static int main_cmd(BShellHandle shell, int argc, char **argv)
}
char *timeBuffer = argv[SERVICE_START_NUMBER];
errno = 0;
uint64_t timeout = strtoull(timeBuffer, NULL, 10);
uint64_t timeout = strtoull(timeBuffer, NULL, DECIMAL_BASE);
if (errno != 0) {
return -1;
}
......
......@@ -321,7 +321,7 @@ static void DoSync(const struct CmdArgs *ctx)
sync();
}
static void DoTimerStart(const struct CmdArgs*ctx)
static void DoTimerStart(const struct CmdArgs *ctx)
{
INIT_LOGI("Timer start service with arg = %s", ctx->argv[0]);
char *arg = ctx->argv[0];
......@@ -358,7 +358,7 @@ static void DoTimerStart(const struct CmdArgs*ctx)
ServiceStartTimer(service, timeout);
}
static void DoTimerStop(const struct CmdArgs*ctx)
static void DoTimerStop(const struct CmdArgs *ctx)
{
INIT_LOGI("Stop service timer with arg = %s", ctx->argv[0]);
const char *serviceName = ctx->argv[0];
......@@ -370,7 +370,7 @@ static void DoTimerStop(const struct CmdArgs*ctx)
ServiceStopTimer(service);
}
static int SyncExecCommand(int argc, char *const *argv)
static int SyncExecCommand(int argc, char * const *argv)
{
if (argc == 0 || argv == NULL || argv[0] == NULL) {
return -1;
......@@ -404,7 +404,7 @@ static void DoInitGlobalKey(const struct CmdArgs *ctx)
INIT_LOGE("DoInitGlobalKey: not data partitation");
return;
}
char *const argv[] = {
char * const argv[] = {
"/system/bin/sdc",
"filecrypt",
"init_global_key",
......@@ -422,7 +422,7 @@ static void DoInitMainUser(const struct CmdArgs *ctx)
INIT_LOGE("DoInitMainUser: para invalid");
return;
}
char *const argv[] = {
char * const argv[] = {
"/system/bin/sdc",
"filecrypt",
"init_main_user",
......
......@@ -613,14 +613,14 @@ static int LoadParamFromCmdLine(void)
return -1, "Failed to read file %s", PARAM_CMD_LINE);
for (size_t i = 0; i < ARRAY_LENGTH(cmdLines); i++) {
#ifdef BOOT_EXTENDED_CMDLINE
#ifdef BOOT_EXTENDED_CMDLINE
ret = GetParamValueFromBuffer(cmdLines[i], BOOT_EXTENDED_CMDLINE, value, PARAM_CONST_VALUE_LEN_MAX);
if (ret != 0) {
ret = GetParamValueFromBuffer(cmdLines[i], data, value, PARAM_CONST_VALUE_LEN_MAX);
}
#else
#else
ret = GetParamValueFromBuffer(cmdLines[i], data, value, PARAM_CONST_VALUE_LEN_MAX);
#endif
#endif
if (ret == 0) {
PARAM_LOGV("Add param from cmdline %s %s", cmdLines[i], value);
ret = CheckParamName(cmdLines[i], 0);
......@@ -753,4 +753,4 @@ void DumpParametersAndTriggers(void)
if (GetTriggerWorkSpace() != NULL) {
DumpTrigger(GetTriggerWorkSpace());
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册