chiark / gitweb /
udp: Print `&' in address descriptions only if multiple sockets
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 23 Oct 2014 18:04:57 +0000 (19:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 23 Oct 2014 18:04:57 +0000 (19:04 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
udp.c

diff --git a/udp.c b/udp.c
index 06acf33..70928a8 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -54,7 +54,7 @@ static const char *udp_addr_to_string(void *commst, const struct comm_addr *ca)
     assert(ix>=0 && ix<socks->n_socks);
     snprintf(sbuf, sizeof(sbuf), "udp:%s%s-%s",
             iaddr_to_string(&socks->socks[ix].addr),
-            ca->ix<0 ? "&" : "",
+            ca->ix<0 && socks->n_socks>1 ? "&" : "",
             iaddr_to_string(&ca->ia));
     return sbuf;
 }