diff options
author | juga0 <juga@riseup.net> | 2018-05-03 08:29:57 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-05-08 14:24:29 -0400 |
commit | dbc80ad19b8a27aab557fe7930e18eef8f415133 (patch) | |
tree | cb83547c7ab9af543fa2198aefc176464a0c62c5 /src/or/dirserv.c | |
parent | 34e7dca9c9e902a58fe8942cef666f1d99d06030 (diff) | |
download | tor-dbc80ad19b8a27aab557fe7930e18eef8f415133.tar.gz tor-dbc80ad19b8a27aab557fe7930e18eef8f415133.zip |
Allow bandwidth-file lines to have node_id in the last position
Closes ticket 26004.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 41c6bf3dc8..d9a9b8522d 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2640,6 +2640,12 @@ measured_bw_line_parse(measured_bw_line_t *out, const char *orig_line) int got_bw = 0; int got_node_id = 0; char *strtok_state; /* lame sauce d'jour */ + + /* Remove end of line character, so that is not part of the token */ + if (line[strlen(line) - 1] == '\n') { + line[strlen(line) - 1] = '\0'; + } + cp = tor_strtok_r(cp, " \t", &strtok_state); if (!cp) { |