提交 50881d86 编写于 作者: D Dmitry Kozlov

cli: fixed bug of incorrect config read procedure

上级 eac88df2
......@@ -344,17 +344,18 @@ static void __init init(void)
int port;
opt = conf_get_opt("cli", "tcp");
if (opt) {
host = strdup(opt);
d = strstr(host, ":");
if (!d) {
return;
}
*d = 0;
port = atoi(d + 1);
if (port <= 0)
goto err_fmt;
}
if (!opt)
return;
host = strdup(opt);
d = strstr(host, ":");
if (!d)
goto err_fmt;
*d = 0;
port = atoi(d + 1);
if (port <= 0)
goto err_fmt;
temp_buf = malloc(RECV_BUF_SIZE);
......
......@@ -633,17 +633,18 @@ static void __init init(void)
int port;
opt = conf_get_opt("cli", "telnet");
if (opt) {
host = strdup(opt);
d = strstr(host, ":");
if (!d) {
return;
}
*d = 0;
port = atoi(d + 1);
if (port <= 0)
goto err_fmt;
}
if (!opt)
return;
host = strdup(opt);
d = strstr(host, ":");
if (!d)
goto err_fmt;
*d = 0;
port = atoi(d + 1);
if (port <= 0)
goto err_fmt;
recv_buf = malloc(RECV_BUF_SIZE);
temp_buf = malloc(RECV_BUF_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册