1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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
This commit is contained in:
Bruce Momjian
2002-09-02 06:11:43 +00:00
parent 48e1a39924
commit a12b4e279b
16 changed files with 107 additions and 105 deletions

View File

@ -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 */