diff options
author | David Rowley | 2019-07-04 01:01:13 +0000 |
---|---|---|
committer | David Rowley | 2019-07-04 01:01:13 +0000 |
commit | 8abc13a88938ef473b8a486186f1b96630450728 (patch) | |
tree | 111864d4f940154a6fd64fd50bc528d396ccde30 /contrib/sepgsql | |
parent | 5683b34956b4e8da9dccadc2e3a53b86104ebb33 (diff) |
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
Diffstat (limited to 'contrib/sepgsql')
-rw-r--r-- | contrib/sepgsql/database.c | 6 | ||||
-rw-r--r-- | contrib/sepgsql/label.c | 2 | ||||
-rw-r--r-- | contrib/sepgsql/selinux.c | 2 |
3 files changed, 5 insertions, 5 deletions
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, diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c index 0b0d21c7f5d..1d17d5a0c04 100644 --- a/contrib/sepgsql/label.c +++ b/contrib/sepgsql/label.c @@ -676,7 +676,7 @@ quote_object_name(const char *src1, const char *src2, if (src1) { temp = quote_identifier(src1); - appendStringInfo(&result, "%s", temp); + appendStringInfoString(&result, temp); if (src1 != temp) pfree((void *) temp); } diff --git a/contrib/sepgsql/selinux.c b/contrib/sepgsql/selinux.c index fbc044e818c..bc2be8427af 100644 --- a/contrib/sepgsql/selinux.c +++ b/contrib/sepgsql/selinux.c @@ -702,7 +702,7 @@ sepgsql_audit_log(bool denied, appendStringInfo(&buf, " %s", av_name); } } - appendStringInfo(&buf, " }"); + appendStringInfoString(&buf, " }"); /* * Call external audit module, if loaded |