From 95fb5d3a1421a0e170f76aafb4bc0ce27a8f2ddd Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 1 Sep 2006 11:27:20 +0000 Subject: [PATCH] Use last rather than first colon in IP address as port separator --- src/tcpip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tcpip.c b/src/tcpip.c index 9a7458c..d951714 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: tcpip.c,v 1.25 2006-09-01 10:39:09 adam Exp $ + * $Id: tcpip.c,v 1.26 2006-09-01 11:27:20 adam Exp $ */ /** * \file tcpip.c @@ -243,7 +243,7 @@ struct addrinfo *tcpip_getaddrinfo(const char *str, const char *port) host[sizeof(host)-1] = 0; if ((p = strchr(host, '/'))) *p = 0; - if ((p = strchr(host, ':'))) + if ((p = strrchr(host, ':'))) { *p = '\0'; port = p+1; @@ -282,7 +282,7 @@ int tcpip_strtoaddr_ex(const char *str, struct sockaddr_in *add, buf[sizeof(buf)-1] = 0; if ((p = strchr(buf, '/'))) *p = 0; - if ((p = strchr(buf, ':'))) + if ((p = strrchr(buf, ':'))) { *p = 0; port = atoi(p + 1); -- 1.7.10.4