aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-09-02 06:11:43 +0000
committerBruce Momjian <bruce@momjian.us>2002-09-02 06:11:43 +0000
commita12b4e279bc12a7cd7b7d679fcac4689ac4aba7b (patch)
treeff120ff0c156829d771bdc874fe8fbb2aa4fbf6e /src/backend/storage/file/fd.c
parent48e1a39924d9e0674306156a6519cf5688c67c43 (diff)
downloadpostgresql-a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b.tar.gz
postgresql-a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b.zip
I checked all the previous string handling errors and most of them were
already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index a3b959fe8f8..83c97fb7550 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.94 2002/09/02 02:47:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.95 2002/09/02 06:11:42 momjian Exp $
*
* NOTES:
*
@@ -344,14 +344,14 @@ _dump_lru(void)
Vfd *vfdP = &VfdCache[mru];
char buf[2048];
- sprintf(buf, "LRU: MOST %d ", mru);
+ snprintf(buf, sizeof(buf), "LRU: MOST %d ", mru);
while (mru != 0)
{
mru = vfdP->lruLessRecently;
vfdP = &VfdCache[mru];
- sprintf(buf + strlen(buf), "%d ", mru);
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%d ", mru);
}
- sprintf(buf + strlen(buf), "LEAST");
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "LEAST");
elog(LOG, buf);
}
#endif /* FDDEBUG */