From: Adam Dickmeiss Date: Fri, 1 Sep 2006 11:27:20 +0000 (+0000) Subject: Use last rather than first colon in IP address as port separator X-Git-Tag: YAZ.2.1.28~4 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=95fb5d3a1421a0e170f76aafb4bc0ce27a8f2ddd;hp=8fbe86c3ff80837cb658fd6f237675ad6c17556d Use last rather than first colon in IP address as port separator --- 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);