aboutsummaryrefslogtreecommitdiff
path: root/src/include/common/string.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-09-13 16:10:44 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-09-13 16:10:44 +0200
commit45b1a67a0fcb3f1588df596431871de4c93cb76f (patch)
tree4bb98640fe0cfda9abc5e656c7c2ad7abec610e1 /src/include/common/string.h
parentda5d4ea5aaac4fc02f2e2aec272efe438dd4e171 (diff)
downloadpostgresql-45b1a67a0fcb3f1588df596431871de4c93cb76f.tar.gz
postgresql-45b1a67a0fcb3f1588df596431871de4c93cb76f.zip
pg_clean_ascii(): escape bytes rather than lose them
Rather than replace each unprintable byte with a '?' character, replace it with a hex escape instead. The API now allocates a copy rather than modifying the input in place. Author: Jacob Champion <jchampion@timescale.com> Discussion: https://www.postgresql.org/message-id/CAAWbhmgsvHrH9wLU2kYc3pOi1KSenHSLAHBbCVmmddW6-mc_=w@mail.gmail.com
Diffstat (limited to 'src/include/common/string.h')
-rw-r--r--src/include/common/string.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/common/string.h b/src/include/common/string.h
index cf00fb53cde..3d59172151b 100644
--- a/src/include/common/string.h
+++ b/src/include/common/string.h
@@ -24,7 +24,7 @@ typedef struct PromptInterruptContext
extern bool pg_str_endswith(const char *str, const char *end);
extern int strtoint(const char *pg_restrict str, char **pg_restrict endptr,
int base);
-extern void pg_clean_ascii(char *str);
+extern char *pg_clean_ascii(const char *str, int alloc_flags);
extern int pg_strip_crlf(char *str);
extern bool pg_is_ascii(const char *str);