X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=connect.c;h=a910af93d8ccf4305dd7e3400f4602184a7c6810;hb=b134922992e3051e7095b1e76a89361fea86206d;hp=dcbbefa69f20027dc62d284e01e3482677c172ae;hpb=5ba884483fe1a5f9ce1ce5e3c5e1c37c0fd296c4;p=git.git diff --git a/connect.c b/connect.c index dcbbefa6..a910af93 100644 --- a/connect.c +++ b/connect.c @@ -119,8 +119,10 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) end = host; colon = strchr(end, ':'); - if (colon) + if (colon) { + *colon = 0; port = colon + 1; + } memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM;