From 2fbbafc88d90635117a917d98438a35b5b06f140 Mon Sep 17 00:00:00 2001 From: Logan oos Even <46396513+Logan007@users.noreply.github.com> Date: Tue, 26 Jan 2021 15:58:05 +0545 Subject: [PATCH] fixed conf file parsing allowing space character inside parameter option, .e.g. `-d Windows TAP` (between "Windows" and "TAP"). --- src/edge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/edge.c b/src/edge.c index b20b172..33a671d 100644 --- a/src/edge.c +++ b/src/edge.c @@ -613,7 +613,9 @@ static int loadFromFile (const char *path, n2n_edge_conf_t *conf, n2n_tuntap_pri // first token, e.g. `-p` or `-A3', eventually followed by a whitespace or '=' delimiter line_vec[1] = strtok(line, "\t ="); // separate parameter option, if present - line_vec[2] = strtok(NULL, "\t "); + line_vec[2] = strtok(NULL, ""); + if(line_vec[2]) + line_vec[2] = trim(line_vec[2]); // not to duplicate the option parser code, call loadFromCLI and pretend we have no option read yet at all optind = 0; // if second token present (optional argument, not part of first), then announce 3 vector members