From 45b1a67a0fcb3f1588df596431871de4c93cb76f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 13 Sep 2022 16:10:44 +0200 Subject: 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 Discussion: https://www.postgresql.org/message-id/CAAWbhmgsvHrH9wLU2kYc3pOi1KSenHSLAHBbCVmmddW6-mc_=w@mail.gmail.com --- src/include/common/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/common/string.h') 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); -- cgit v1.2.3