提交 054a78a7 编写于 作者: X xionglei6

init: fix bugs

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 695d9741
......@@ -298,13 +298,13 @@ char *GetFstabFile(void)
return NULL;
}
} else {
char hardware[MAX_CMDLINE_VALUE_LEN] = {0};
char hardware[MAX_BUFFER_LEN] = {0};
char *buffer = ReadFileData("/proc/cmdline");
if (buffer == NULL) {
FSMGR_LOGE("Failed read \"/proc/cmdline\"");
return NULL;
}
int ret = GetProcCmdlineValue("hardware", buffer, hardware, MAX_CMDLINE_VALUE_LEN);
int ret = GetProcCmdlineValue("hardware", buffer, hardware, MAX_BUFFER_LEN);
free(buffer);
if (ret != 0) {
FSMGR_LOGE("Failed get hardware from cmdline");
......
......@@ -29,7 +29,7 @@ extern "C" {
#define OCTAL_BASE 8
#define DECIMAL_BASE 10
#define WAIT_MAX_COUNT 10
#define MAX_CMDLINE_VALUE_LEN 96
#define MAX_BUFFER_LEN 256
#define ARRAY_LENGTH(array) (sizeof((array)) / sizeof((array)[0]))
uid_t DecodeUid(const char *name);
char *ReadFileToBuf(const char *configFile);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册