diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-11-18 06:51:29 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-11-18 06:51:29 +0000 |
commit | 366ba4a7c788c80e3a5ddc3df62066a61abffa82 (patch) | |
tree | 08eef0f2c390fa0f65dd619246c99eef53625bdb | |
parent | 51de02bcb523d52511e0e645b765bc5bc4790323 (diff) | |
download | tor-366ba4a7c788c80e3a5ddc3df62066a61abffa82.tar.gz tor-366ba4a7c788c80e3a5ddc3df62066a61abffa82.zip |
Always include newline with port section of exit policy
svn:r832
-rw-r--r-- | src/or/routers.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/or/routers.c b/src/or/routers.c index c25aa6eadb..9d6bc002f4 100644 --- a/src/or/routers.c +++ b/src/or/routers.c @@ -1285,7 +1285,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router, return -1; } written += result; - if (tmpe->msk != 0xFFFFFFFFu) { + if (tmpe->msk != 0xFFFFFFFFu && tmpe->msk != 0) { in.s_addr = htonl(tmpe->msk); result = snprintf(s+written, maxlen-written, "/%s", inet_ntoa(in)); if (result<0 || result+written > maxlen) @@ -1293,19 +1293,16 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router, written += result; } if (tmpe->prt) { - result = snprintf(s+written, maxlen-written, ":%d", tmpe->prt); + result = snprintf(s+written, maxlen-written, ":%d\n", tmpe->prt); if (result<0 || result+written > maxlen) return -1; written += result; } else { if (written > maxlen-4) return -1; - strcat(s+written, ":*"); + strcat(s+written, ":*\n"); + written += 3; } - if(written > maxlen-1) - return -1; - strcat(s+written, "\n"); - written++; } /* end for */ if (written > maxlen-256) /* Not enough room for signature. */ return -1; |