diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-04-30 17:09:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-04-30 17:09:13 +0000 |
commit | 09543580471182ecab3b73c982485397edabbce2 (patch) | |
tree | b622ef3f45302ca9129bd04b67ef7be7ac85ea35 /src/interfaces/libpq/fe-connect.c | |
parent | 21992dd4f5165692dcf039b3ed192a759dcc4f2c (diff) | |
download | postgresql-09543580471182ecab3b73c982485397edabbce2.tar.gz postgresql-09543580471182ecab3b73c982485397edabbce2.zip |
Fix a couple of places where the result of fgets() wasn't checked.
This is mostly to suppress compiler warnings, although in principle
the cases could result in undesirable behavior.
Martin Pitt
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index e2d1355a3db..54db2b7b896 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.391 2010/03/17 20:58:38 petere Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.392 2010/04/30 17:09:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4400,7 +4400,8 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username) *ret; int len; - fgets(buf, sizeof(buf), fp); + if (fgets(buf, sizeof(buf), fp) == NULL) + break; len = strlen(buf); if (len == 0) |