summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorPeter Eisentraut2007-02-08 11:10:27 +0000
committerPeter Eisentraut2007-02-08 11:10:27 +0000
commit086c189456655846707d9a260a3919f4404ecd9e (patch)
treec4c34d96579d19884bdc12cec5dec76f6a8f962c /src/tools
parentb79575ce4599db628a09773003b2e73d81d75f54 (diff)
Normalize fgets() calls to use sizeof() for calculating the buffer size
where possible, and fix some sites that apparently thought that fgets() will overwrite the buffer by one byte. Also add some strlcpy() to eliminate some weird memory handling.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/entab/entab.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/entab/entab.c b/src/tools/entab/entab.c
index 62279122f8..7a87e0d5ab 100644
--- a/src/tools/entab/entab.c
+++ b/src/tools/entab/entab.c
@@ -2,7 +2,7 @@
** entab.c - add tabs to a text file
** by Bruce Momjian (root@candle.pha.pa.us)
**
-** $PostgreSQL: pgsql/src/tools/entab/entab.c,v 1.17 2007/02/01 19:10:30 momjian Exp $
+** $PostgreSQL: pgsql/src/tools/entab/entab.c,v 1.18 2007/02/08 11:10:27 petere Exp $
**
** version 1.3
**
@@ -108,7 +108,7 @@ main(int argc, char **argv)
escaped = FALSE;
- while (fgets(in_line, BUFSIZ, in_file) != NULL)
+ while (fgets(in_line, sizeof(in_line), in_file) != NULL)
{
col_in_tab = 0;
prv_spaces = 0;