* Trim and replace each character with ascii code below 32 or above * 127 (included) using a dot '.' character. */
| 17 | * 127 (included) using a dot '.' character. |
| 18 | */ |
| 19 | static 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 | |
| 28 | const char *git_user_agent(void) |
| 29 | { |
no test coverage detected