X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Finvitation.c;h=1fba77e15f3c1e4099ef2e7c6be33e0e8aef7b4f;hb=ea6d38aa8cbb366831153575c725022db7f84a82;hp=14a4120c80719af6270f28706250c28a43fab607;hpb=a1b50920b9a52f86ca6e33fcb24d7fa34313a1ee;p=meshlink diff --git a/src/invitation.c b/src/invitation.c index 14a4120c..1fba77e1 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -194,8 +194,10 @@ done: else xasprintf(&hostport, "%s:%s", hostname, port); } else { - hostport = hostname; - hostname = NULL; + if(strchr(hostname, ':')) + xasprintf(&hostport, "[%s]", hostname); + else + hostport = xstrdup(hostname); } free(hostname);