mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Stop requiring newline at end of exit policy.
svn:r554
This commit is contained in:
parent
499bbe72d4
commit
686fce453b
1 changed files with 6 additions and 1 deletions
|
@ -952,8 +952,13 @@ int router_add_exit_policy_from_string(routerinfo_t *router,
|
||||||
directory_token_t tok;
|
directory_token_t tok;
|
||||||
char *tmp, *cp;
|
char *tmp, *cp;
|
||||||
int r;
|
int r;
|
||||||
|
int len;
|
||||||
|
|
||||||
tmp = cp = tor_strdup(s);
|
len = strlen(s);
|
||||||
|
tmp = cp = tor_malloc(len+2);
|
||||||
|
strcpy(tmp, s);
|
||||||
|
tmp[len]='\n';
|
||||||
|
tmp[len+1]='\0';
|
||||||
if (router_get_next_token(&cp, &tok)) {
|
if (router_get_next_token(&cp, &tok)) {
|
||||||
log_fn(LOG_WARNING, "Error reading exit policy: %s", tok.val.error);
|
log_fn(LOG_WARNING, "Error reading exit policy: %s", tok.val.error);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue