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:
Miroslav Lichvar 2016-06-27 14:38:51 +02:00
parent b703bc32c9
commit 78f20f7b3e

7
conf.c
View file

@ -696,9 +696,9 @@ parse_refclock(char *line)
line = CPS_SplitWord(line);
param = Strdup(p);
while (*line) {
cmd = line;
for (cmd = line; *cmd; line += n, cmd = line) {
line = CPS_SplitWord(line);
if (!strcasecmp(cmd, "refid")) {
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
break;
@ -756,10 +756,9 @@ parse_refclock(char *line)
other_parse_error("Invalid refclock option");
return;
}
line += n;
}
if (*line) {
if (*cmd) {
command_parse_error();
return;
}