chiark / gitweb /
udp: Print `&' in address descriptions only if multiple sockets
[secnet.git] / udp.c
diff --git a/udp.c b/udp.c
index 06acf3345e9806ca71eaa6278544f48eb067a802..70928a8109fb130edd5fa53c977cc41fbeb551de 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;
 }