MCPcopy Create free account
hub / github.com/git/git / redact_non_printables

Function redact_non_printables

version.c:19–26  ·  view source on GitHub ↗

* Trim and replace each character with ascii code below 32 or above * 127 (included) using a dot '.' character. */

Source from the content-addressed store, hash-verified

17 * 127 (included) using a dot '.' character.
18 */
19static void redact_non_printables(struct strbuf *buf)
20{
21 strbuf_trim(buf);
22 for (size_t i = 0; i < buf->len; i++) {
23 if (!isprint(buf->buf[i]) || buf->buf[i] == ' ')
24 buf->buf[i] = '.';
25 }
26}
27
28const char *git_user_agent(void)
29{

Callers 2

os_infoFunction · 0.85
git_user_agent_sanitizedFunction · 0.85

Calls 1

strbuf_trimFunction · 0.85

Tested by

no test coverage detected