aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-04-03 21:50:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-04-03 21:50:23 +0000
commit14e6823c7c794ee28ca79d5446757a5022b25ad4 (patch)
tree8edbb372ccbc8154e2818a0235cce66bb49ac996 /src
parent61c9ea0f3c6424fce30a2c47cf012a6d79c41da9 (diff)
downloadpostgresql-14e6823c7c794ee28ca79d5446757a5022b25ad4.tar.gz
postgresql-14e6823c7c794ee28ca79d5446757a5022b25ad4.zip
Don't re-invent the strchr() wheel.
Diffstat (limited to 'src')
-rw-r--r--src/backend/libpq/ip.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/backend/libpq/ip.c b/src/backend/libpq/ip.c
index 74096c41926..009887b269a 100644
--- a/src/backend/libpq/ip.c
+++ b/src/backend/libpq/ip.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.5 2003/04/02 20:00:21 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.6 2003/04/03 21:50:23 tgl Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -212,17 +212,10 @@ int
SockAddr_pton(SockAddr *sa, const char *src)
{
int family = AF_INET;
-#ifdef HAVE_IPV6
- const char *ch;
- for (ch = src; *ch != '\0'; ch++)
- {
- if (*ch == ':')
- {
- family = AF_INET6;
- break;
- }
- }
+#ifdef HAVE_IPV6
+ if (strchr(src, ':'))
+ family = AF_INET6;
#endif
sa->sa.sa_family = family;