conf: fix parsing of refclock directive
Don't accept refclock directive which has as the last argument an option that requires a value.
This commit is contained in:
parent
b703bc32c9
commit
78f20f7b3e
1 changed files with 3 additions and 4 deletions
7
conf.c
7
conf.c
|
@ -696,9 +696,9 @@ parse_refclock(char *line)
|
||||||
line = CPS_SplitWord(line);
|
line = CPS_SplitWord(line);
|
||||||
param = Strdup(p);
|
param = Strdup(p);
|
||||||
|
|
||||||
while (*line) {
|
for (cmd = line; *cmd; line += n, cmd = line) {
|
||||||
cmd = line;
|
|
||||||
line = CPS_SplitWord(line);
|
line = CPS_SplitWord(line);
|
||||||
|
|
||||||
if (!strcasecmp(cmd, "refid")) {
|
if (!strcasecmp(cmd, "refid")) {
|
||||||
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
|
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
|
||||||
break;
|
break;
|
||||||
|
@ -756,10 +756,9 @@ parse_refclock(char *line)
|
||||||
other_parse_error("Invalid refclock option");
|
other_parse_error("Invalid refclock option");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
line += n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*line) {
|
if (*cmd) {
|
||||||
command_parse_error();
|
command_parse_error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue