From 8abc13a88938ef473b8a486186f1b96630450728 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Thu, 4 Jul 2019 13:01:13 +1200 Subject: Use appendStringInfoString and appendPQExpBufferStr where possible This changes various places where appendPQExpBuffer was used in places where it was possible to use appendPQExpBufferStr, and likewise for appendStringInfo and appendStringInfoString. This is really just a stylistic improvement, but there are also small performance gains to be had from doing this. Discussion: http://postgr.es/m/CAKJS1f9P=M-3ULmPvr8iCno8yvfDViHibJjpriHU8+SXUgeZ=w@mail.gmail.com --- contrib/sepgsql/database.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/sepgsql/database.c') diff --git a/contrib/sepgsql/database.c b/contrib/sepgsql/database.c index 0cffb69c76b..8edd3df643c 100644 --- a/contrib/sepgsql/database.c +++ b/contrib/sepgsql/database.c @@ -63,7 +63,7 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate) * check db_database:{getattr} permission */ initStringInfo(&audit_name); - appendStringInfo(&audit_name, "%s", quote_identifier(dtemplate)); + appendStringInfoString(&audit_name, quote_identifier(dtemplate)); sepgsql_avc_check_perms_label(tcontext, SEPG_CLASS_DB_DATABASE, SEPG_DB_DATABASE__GETATTR, @@ -101,8 +101,8 @@ sepgsql_database_post_create(Oid databaseId, const char *dtemplate) * check db_database:{create} permission */ resetStringInfo(&audit_name); - appendStringInfo(&audit_name, "%s", - quote_identifier(NameStr(datForm->datname))); + appendStringInfoString(&audit_name, + quote_identifier(NameStr(datForm->datname))); sepgsql_avc_check_perms_label(ncontext, SEPG_CLASS_DB_DATABASE, SEPG_DB_DATABASE__CREATE, -- cgit v1.2.3