diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-10-07 22:15:47 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-10-07 22:15:47 +0000 |
commit | 686fce453b4985e79734d1770d9931272cf7053f (patch) | |
tree | 42b3145acba28482734fedde61b65464efc79167 /src/or/routers.c | |
parent | 499bbe72d45758e879a176203e25fcceec22e9d2 (diff) | |
download | tor-686fce453b4985e79734d1770d9931272cf7053f.tar.gz tor-686fce453b4985e79734d1770d9931272cf7053f.zip |
Stop requiring newline at end of exit policy.
svn:r554
Diffstat (limited to 'src/or/routers.c')
-rw-r--r-- | src/or/routers.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/routers.c b/src/or/routers.c index 29a78f410f..5921ce9f17 100644 --- a/src/or/routers.c +++ b/src/or/routers.c @@ -952,8 +952,13 @@ int router_add_exit_policy_from_string(routerinfo_t *router, directory_token_t tok; char *tmp, *cp; 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)) { log_fn(LOG_WARNING, "Error reading exit policy: %s", tok.val.error); free(tmp); |