19 nmsg_asprintf(
char **strp,
const char *fmt, ...) {
24 status = nmsg_vasprintf(strp, fmt, args);
30 nmsg_vasprintf(
char **strp,
const char *fmt, va_list args) {
34 va_copy(args_copy, args);
35 needed = vsnprintf(NULL, 0, fmt, args_copy);
41 *strp = malloc(needed + 1);
44 status = vsnprintf(*strp, needed + 1, fmt, args);
Asprintf utility functions.