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