diff options
author | David Rowley | 2025-04-16 23:37:55 +0000 |
---|---|---|
committer | David Rowley | 2025-04-16 23:37:55 +0000 |
commit | 3fae25cbb35aa885c411fb51f55a64bb80dc5844 (patch) | |
tree | 5e4438e2c2bb37d559ef2cc47e16886615a3f17b /src/test | |
parent | f3281f9f9395099724b55ddc52991a92795c6068 (diff) |
Fixup various new-to-v18 usages of appendPQExpBuffer
Use appendPQExpBufferStr when there are no parameters and
appendPQExpBufferChar when the string length is 1.
Author: David Rowley <drowleyml@gmail.com>
Discussion: https://postgr.es/m/CAApHDvoARMvPeXTTC0HnpARBHn-WgVstc8XFCyMGOzvgu_1HvQ@mail.gmail.com
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/modules/test_escape/test_escape.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/test/modules/test_escape/test_escape.c b/src/test/modules/test_escape/test_escape.c index f6b36448977..0b4883cc7c8 100644 --- a/src/test/modules/test_escape/test_escape.c +++ b/src/test/modules/test_escape/test_escape.c @@ -96,8 +96,7 @@ escape_literal(PGconn *conn, PQExpBuffer target, escaped = PQescapeLiteral(conn, unescaped, unescaped_len); if (!escaped) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -120,8 +119,7 @@ escape_identifier(PGconn *conn, PQExpBuffer target, escaped = PQescapeIdentifier(conn, unescaped, unescaped_len); if (!escaped) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -153,8 +151,7 @@ escape_string_conn(PGconn *conn, PQExpBuffer target, if (error) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -514,7 +511,7 @@ test_psql_parse(pe_test_config *tc, PQExpBuffer testname, "#\t\t %d: scan_result: %s prompt: %u, query_buf: ", matches, scan_res_s(scan_result), prompt_status); escapify(details, query_buf->data, query_buf->len); - appendPQExpBuffer(details, "\n"); + appendPQExpBufferChar(details, '\n'); matches++; } @@ -566,7 +563,7 @@ test_one_vector_escape(pe_test_config *tc, const pe_test_vector *tv, const pe_te } /* name to describe the test */ - appendPQExpBuffer(testname, ">"); + appendPQExpBufferChar(testname, '>'); escapify(testname, tv->escape, tv->escape_len); appendPQExpBuffer(testname, "< - %s - %s", tv->client_encoding, ef->name); @@ -575,7 +572,7 @@ test_one_vector_escape(pe_test_config *tc, const pe_test_vector *tv, const pe_te appendPQExpBuffer(details, "#\t input: %zd bytes: ", tv->escape_len); escapify(details, tv->escape, tv->escape_len); - appendPQExpBufferStr(details, "\n"); + appendPQExpBufferChar(details, '\n'); appendPQExpBuffer(details, "#\t encoding: %s\n", tv->client_encoding); |