File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
* This file and the IPV6 implementation were initially provided by
14
14
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -212,17 +212,10 @@ int
212
212
SockAddr_pton (SockAddr * sa , const char * src )
213
213
{
214
214
int family = AF_INET ;
215
- #ifdef HAVE_IPV6
216
- const char * ch ;
217
215
218
- for (ch = src ; * ch != '\0' ; ch ++ )
219
- {
220
- if (* ch == ':' )
221
- {
222
- family = AF_INET6 ;
223
- break ;
224
- }
225
- }
216
+ #ifdef HAVE_IPV6
217
+ if (strchr (src , ':' ))
218
+ family = AF_INET6 ;
226
219
#endif
227
220
228
221
sa -> sa .sa_family = family ;
You can’t perform that action at this time.
0 commit comments