| 74 | } |
| 75 | |
| 76 | static void capture_log_sink(const char *line) { |
| 77 | size_t used = strlen(g_log_capture); |
| 78 | size_t avail = sizeof(g_log_capture) - used; |
| 79 | if (avail <= 1) { |
| 80 | return; |
| 81 | } |
| 82 | int n = snprintf(g_log_capture + used, avail, "%s\n", line); |
| 83 | if (n < 0 || (size_t)n >= avail) { |
| 84 | g_log_capture[sizeof(g_log_capture) - 1] = '\0'; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | static void capture_logs_start(void) { |
| 89 | g_log_capture[0] = '\0'; |
nothing calls this directly
no outgoing calls
no test coverage detected