We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent45f9217 commite41b8a0Copy full SHA for e41b8a0
src/interfaces/libpq/fe-connect.c
@@ -8,7 +8,7 @@
8
*
9
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.157 2000/12/31 18:15:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.158 2000/12/31 18:23:21 tgl Exp $
12
13
*-------------------------------------------------------------------------
14
*/
@@ -861,7 +861,11 @@ connectDBStart(PGconn *conn)
861
conn->raddr.sa.sa_family=family;
862
863
/* Set port number */
864
-portno=atoi(conn->pgport);
+if (conn->pgport!=NULL&&conn->pgport[0]!='\0')
865
+portno=atoi(conn->pgport);
866
+else
867
+portno=DEF_PGPORT;
868
+
869
if (family==AF_INET)
870
{
871
conn->raddr.in.sin_port=htons((unsigned short) (portno));
@@ -875,7 +879,6 @@ connectDBStart(PGconn *conn)
875
879
}
876
880
#endif
877
881
878
-
882
/* Open a socket */
883
if ((conn->sock=socket(family,SOCK_STREAM,0))<0)
884