summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2007-02-08 11:10:27 +0000
committerPeter Eisentraut <peter_e@gmx.net>2007-02-08 11:10:27 +0000
commit086c189456655846707d9a260a3919f4404ecd9e (patch)
treec4c34d96579d19884bdc12cec5dec76f6a8f962c /src/backend/access/transam/xlog.c
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/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b1a5a57b2f4..fa6731a3869 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.262 2007/02/07 16:44:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.263 2007/02/08 11:10:27 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3374,7 +3374,7 @@ readTimeLineHistory(TimeLineID targetTLI)
/*
* Parse the file...
*/
- while (fgets(fline, MAXPGPATH, fd) != NULL)
+ while (fgets(fline, sizeof(fline), fd) != NULL)
{
/* skip leading whitespace and check for # comment */
char *ptr;
@@ -4248,7 +4248,7 @@ readRecoveryCommandFile(void)
/*
* Parse the file...
*/
- while (fgets(cmdline, MAXPGPATH, fd) != NULL)
+ while (fgets(cmdline, sizeof(cmdline), fd) != NULL)
{
/* skip leading whitespace and check for # comment */
char *ptr;