Browse Source

fix #44

pull/45/head
Max Lv 11 years ago
parent
commit
e9a7c0166b
1 changed files with 7 additions and 1 deletions
  1. 8
      src/jconf.c

8
src/jconf.c

@ -36,14 +36,20 @@ static char *to_string(const json_value *value)
}
static void parse_addr(const char *str, remote_addr_t *addr) {
int ret = -1;
int ret = -1, n = 0;
char *pch;
pch = strchr(str, ':');
while (pch != NULL)
{
n++;
ret = pch - str;
pch = strchr(pch + 1, ':');
}
if (n > 1) {
if (strcmp(str+ret, "]") != 0) {
ret = -1;
}
}
if (ret == -1)
{
addr->host = str;

Loading…
Cancel
Save