| 81 | } |
| 82 | |
| 83 | static char *string_format(const char *format, ...) { |
| 84 | va_list args; |
| 85 | va_start(args, format); |
| 86 | va_list measure; |
| 87 | va_copy(measure, args); |
| 88 | int needed = vsnprintf(NULL, 0, format, measure); |
| 89 | va_end(measure); |
| 90 | if (needed < 0) { |
| 91 | va_end(args); |
| 92 | return NULL; |
| 93 | } |
| 94 | char *result = malloc((size_t)needed + 1); |
| 95 | if (!result || vsnprintf(result, (size_t)needed + 1, format, args) != needed) { |
| 96 | free(result); |
| 97 | result = NULL; |
| 98 | } |
| 99 | va_end(args); |
| 100 | return result; |
| 101 | } |
| 102 | |
| 103 | #ifndef _WIN32 |
| 104 | static cbm_daemon_ipc_posix_publication_hook_fn g_posix_publication_hook_for_test; |
no outgoing calls
no test coverage detected