From 50881d86b036e3b658c45e56b57b12a60e1562ef Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 15 Nov 2010 23:46:13 +0300 Subject: cli: fixed bug of incorrect config read procedure --- accel-pptpd/cli/tcp.c | 23 ++++++++++++----------- accel-pptpd/cli/telnet.c | 23 ++++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/accel-pptpd/cli/tcp.c b/accel-pptpd/cli/tcp.c index 687c97f4..582c1752 100644 --- a/accel-pptpd/cli/tcp.c +++ b/accel-pptpd/cli/tcp.c @@ -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); diff --git a/accel-pptpd/cli/telnet.c b/accel-pptpd/cli/telnet.c index 69e484f5..d38e056b 100644 --- a/accel-pptpd/cli/telnet.c +++ b/accel-pptpd/cli/telnet.c @@ -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); -- cgit v1.2.3