|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.308 2005/06/1003:02:30 momjian Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.309 2005/06/1004:01:36 momjian Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -3237,22 +3237,15 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username) |
3237 | 3237 | port=DEF_PGPORT_STR; |
3238 | 3238 |
|
3239 | 3239 | if ((passfile_env=getenv("PGPASSFILE"))!=NULL) |
3240 | | -{ |
3241 | 3240 | /* use the literal path from the environment, if set */ |
3242 | 3241 | StrNCpy(pgpassfile,passfile_env,MAXPGPATH); |
3243 | | -if (!pgpassfile) |
3244 | | -{ |
3245 | | -fprintf(stderr,libpq_gettext("out of memory\n")); |
3246 | | -returnNULL; |
3247 | | -} |
3248 | | -} |
3249 | 3242 | else |
3250 | 3243 | { |
3251 | 3244 | charhomedir[MAXPGPATH]; |
3252 | 3245 |
|
3253 | 3246 | if (!pqGetHomeDirectory(homedir,sizeof(homedir))) |
3254 | 3247 | returnNULL; |
3255 | | -snprintf(pgpassfile,sizeof(pgpassfile),"%s/%s",homedir,PGPASSFILE); |
| 3248 | +snprintf(pgpassfile,MAXPGPATH,"%s/%s",homedir,PGPASSFILE); |
3256 | 3249 | } |
3257 | 3250 |
|
3258 | 3251 | /* If password file cannot be opened, ignore it. */ |
|