summaryrefslogtreecommitdiff
path: root/accel-pptpd/cli
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-11-15 23:46:13 +0300
committerDmitry Kozlov <xeb@mail.ru>2010-11-15 23:46:13 +0300
commit50881d86b036e3b658c45e56b57b12a60e1562ef (patch)
tree8163b3bbcf3a6d742b8212733c1b6529b13c4f4b /accel-pptpd/cli
parenteac88df2bb16edbfa37541e1bb477d0873825d12 (diff)
downloadaccel-ppp-50881d86b036e3b658c45e56b57b12a60e1562ef.tar.gz
accel-ppp-50881d86b036e3b658c45e56b57b12a60e1562ef.zip
cli: fixed bug of incorrect config read procedure
Diffstat (limited to 'accel-pptpd/cli')
-rw-r--r--accel-pptpd/cli/tcp.c23
-rw-r--r--accel-pptpd/cli/telnet.c23
2 files changed, 24 insertions, 22 deletions
diff --git a/accel-pptpd/cli/tcp.c b/accel-pptpd/cli/tcp.c
index 687c97f..582c175 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 69e484f..d38e056 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);