mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Always include newline with port section of exit policy
svn:r832
This commit is contained in:
parent
51de02bcb5
commit
366ba4a7c7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user