| 17 | }; |
| 18 | |
| 19 | static char *git_strdup(const char *s) { |
| 20 | if (!s) { |
| 21 | s = ""; |
| 22 | } |
| 23 | size_t n = strlen(s) + 1; |
| 24 | char *out = (char *)malloc(n); |
| 25 | if (!out) { |
| 26 | return NULL; |
| 27 | } |
| 28 | memcpy(out, s, n); |
| 29 | return out; |
| 30 | } |
| 31 | |
| 32 | static void trim_newlines(char *s) { |
| 33 | if (!s) { |
no outgoing calls
no test coverage detected