Skip to content

Commit d02f164

Browse files
committed
Replace some appendStringInfo* calls with more appropriate variants
Author: David Rowley <dgrowleyml@gmail.com>
1 parent b488c58 commit d02f164

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,7 +2734,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
27342734
appendStringInfoString(&buf, ", ");
27352735
deparseStringLiteral(&buf, rv->relname);
27362736
}
2737-
appendStringInfoString(&buf, ")");
2737+
appendStringInfoChar(&buf, ')');
27382738
}
27392739

27402740
/* Append ORDER BY at the end of query to ensure output ordering */
@@ -2798,7 +2798,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
27982798
*/
27992799
appendStringInfoString(&buf, " OPTIONS (column_name ");
28002800
deparseStringLiteral(&buf, attname);
2801-
appendStringInfoString(&buf, ")");
2801+
appendStringInfoChar(&buf, ')');
28022802

28032803
/* Add COLLATE if needed */
28042804
if (import_collate && collname != NULL && collnamespace != NULL)

contrib/test_decoding/test_decoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
419419
get_namespace_name(
420420
get_rel_namespace(RelationGetRelid(relation))),
421421
NameStr(class_form->relname)));
422-
appendStringInfoString(ctx->out, ":");
422+
appendStringInfoChar(ctx->out, ':');
423423

424424
switch (change->action)
425425
{

src/backend/access/rmgrdesc/smgrdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ smgr_desc(StringInfo buf, XLogReaderState *record)
2929
xl_smgr_create *xlrec = (xl_smgr_create *) rec;
3030
char *path = relpathperm(xlrec->rnode, xlrec->forkNum);
3131

32-
appendStringInfo(buf, "%s", path);
32+
appendStringInfoString(buf, path);
3333
pfree(path);
3434
}
3535
else if (info == XLOG_SMGR_TRUNCATE)

src/backend/access/rmgrdesc/xlogdesc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
7575
{
7676
xl_restore_point *xlrec = (xl_restore_point *) rec;
7777

78-
appendStringInfo(buf, "%s", xlrec->rp_name);
78+
appendStringInfoString(buf, xlrec->rp_name);
7979
}
8080
else if (info == XLOG_FPI || info == XLOG_FPI_FOR_HINT)
8181
{
@@ -125,7 +125,7 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
125125
bool fpw;
126126

127127
memcpy(&fpw, rec, sizeof(bool));
128-
appendStringInfo(buf, "%s", fpw ? "true" : "false");
128+
appendStringInfoString(buf, fpw ? "true" : "false");
129129
}
130130
else if (info == XLOG_END_OF_RECOVERY)
131131
{

src/backend/catalog/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,7 @@ NameListToString(List *names)
29372937
if (IsA(name, String))
29382938
appendStringInfoString(&string, strVal(name));
29392939
else if (IsA(name, A_Star))
2940-
appendStringInfoString(&string, "*");
2940+
appendStringInfoChar(&string, '*');
29412941
else
29422942
elog(ERROR, "unexpected node type in name list: %d",
29432943
(int) nodeTag(name));

src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ print_function_rettype(StringInfo buf, HeapTuple proctup)
21742174
appendStringInfoString(&rbuf, "TABLE(");
21752175
ntabargs = print_function_arguments(&rbuf, proctup, true, false);
21762176
if (ntabargs > 0)
2177-
appendStringInfoString(&rbuf, ")");
2177+
appendStringInfoChar(&rbuf, ')');
21782178
else
21792179
resetStringInfo(&rbuf);
21802180
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy