Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14e6823

Browse files
committed
Don't re-invent the strchr() wheel.
1 parent61c9ea0 commit14e6823

File tree

1 file changed

+4
-11
lines changed
  • src/backend/libpq

1 file changed

+4
-11
lines changed

‎src/backend/libpq/ip.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.5 2003/04/02 20:00:21 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.6 2003/04/03 21:50:23 tgl Exp $
1212
*
1313
* This file and the IPV6 implementation were initially provided by
1414
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -212,17 +212,10 @@ int
212212
SockAddr_pton(SockAddr*sa,constchar*src)
213213
{
214214
intfamily=AF_INET;
215-
#ifdefHAVE_IPV6
216-
constchar*ch;
217215

218-
for (ch=src;*ch!='\0';ch++)
219-
{
220-
if (*ch==':')
221-
{
222-
family=AF_INET6;
223-
break;
224-
}
225-
}
216+
#ifdefHAVE_IPV6
217+
if (strchr(src,':'))
218+
family=AF_INET6;
226219
#endif
227220

228221
sa->sa.sa_family=family;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp