1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Initial attempt to clean up the code...

Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
	code
This commit is contained in:
Marc G. Fournier
1998-12-14 05:19:16 +00:00
parent f722af618a
commit 7c3b7d2744
21 changed files with 5898 additions and 5812 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.27 1998/11/22 10:48:34 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.28 1998/12/14 05:18:43 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -146,11 +146,11 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest)
static void
explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
{
List *l;
List *l;
Relation relation;
char *pname;
char buf[1000];
int i;
char *pname,
buf[1000];
int i;
if (plan == NULL)
{
@ -207,11 +207,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
break;
}
#if 0
for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
#endif
appendStringInfo(str, pname);
switch (nodeTag(plan))
{
@ -233,7 +228,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
appendStringInfo(str, " on ");
if (strcmp(rte->refname, rte->relname) != 0)
{
sprintf(buf, "%s ", rte->relname);
snprintf(buf, 1000, "%s ", rte->relname);
appendStringInfo(str, buf);
}
appendStringInfo(str, rte->refname);
@ -244,7 +239,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
}
if (es->printCost)
{
sprintf(buf, " (cost=%.2f size=%d width=%d)",
snprintf(buf, 1000, " (cost=%.2f size=%d width=%d)",
plan->cost, plan->plan_size, plan->plan_width);
appendStringInfo(str, buf);
}