aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/input.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-27 02:20:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-27 02:20:36 +0000
commit9c5327b99be079f9052efaee210f7e517bc48219 (patch)
treec0cce051dccecfbeb1feb76e4567602c75d53424 /src/bin/psql/input.c
parente8a72c0db22b75144dd2ec0410352dbf34d4bde6 (diff)
downloadpostgresql-9c5327b99be079f9052efaee210f7e517bc48219.tar.gz
postgresql-9c5327b99be079f9052efaee210f7e517bc48219.zip
Pay attention to failure returns from fgets() in all cases.
Avoid infinite loop prompting for password at stdin EOF.
Diffstat (limited to 'src/bin/psql/input.c')
-rw-r--r--src/bin/psql/input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 86200ad0522..78e2ae3568a 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.13 2000/04/12 17:16:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.14 2000/11/27 02:20:36 tgl Exp $
*/
#include "postgres.h"
#include "input.h"
@@ -91,7 +91,7 @@ gets_fromFile(FILE *source)
initPQExpBuffer(&buffer);
- while (fgets(line, 1024, source) != NULL)
+ while (fgets(line, sizeof(line), source) != NULL)
{
appendPQExpBufferStr(&buffer, line);
if (buffer.data[buffer.len - 1] == '\n')