diff options
author | Jani Nikula <jani@nikula.org> | 2014-02-03 21:51:43 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-03-09 10:13:30 -0300 |
commit | 029790d3ff6e9fccfed2214efac777b8c438e318 (patch) | |
tree | acbba0b5ea47f3641cce0d2db67c07e745148999 /util/string-util.h | |
parent | 998a8a95c3cd19950b78c50912345669952ba3eb (diff) |
util: make sanitize string available in string util for reuse
No functional changes.
Diffstat (limited to 'util/string-util.h')
-rw-r--r-- | util/string-util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/string-util.h b/util/string-util.h index 0194607e..8a3ad19e 100644 --- a/util/string-util.h +++ b/util/string-util.h @@ -19,6 +19,13 @@ char *strtok_len (char *s, const char *delim, size_t *len); +/* Return a talloced string with str sanitized. + * + * Whitespace characters (tabs and newlines) are replaced with spaces, + * non-printable characters with question marks. + */ +char *sanitize_string (const void *ctx, const char *str); + /* Construct a boolean term query with the specified prefix (e.g., * "id") and search term, quoting term as necessary. Specifically, if * term contains any non-printable ASCII characters, non-ASCII |