Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c1e4869

Browse files
committed
Remove unneeded variable test, per Tom.
1 parent a87ee00 commit c1e4869

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/interfaces/libpq/fe-connect.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.308 2005/06/10 03:02:30 momjian Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.309 2005/06/10 04:01:36 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3237,22 +3237,15 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
32373237
port = DEF_PGPORT_STR;
32383238

32393239
if ((passfile_env = getenv("PGPASSFILE")) != NULL)
3240-
{
32413240
/* use the literal path from the environment, if set */
32423241
StrNCpy(pgpassfile, passfile_env, MAXPGPATH);
3243-
if (!pgpassfile)
3244-
{
3245-
fprintf(stderr, libpq_gettext("out of memory\n"));
3246-
return NULL;
3247-
}
3248-
}
32493242
else
32503243
{
32513244
char homedir[MAXPGPATH];
32523245

32533246
if (!pqGetHomeDirectory(homedir, sizeof(homedir)))
32543247
return NULL;
3255-
snprintf(pgpassfile, sizeof(pgpassfile), "%s/%s", homedir, PGPASSFILE);
3248+
snprintf(pgpassfile, MAXPGPATH, "%s/%s", homedir, PGPASSFILE);
32563249
}
32573250

32583251
/* If password file cannot be opened, ignore it. */

0 commit comments

Comments
 (0)