/** * Realloc @p s to append the formatted result of @p fmt and return @p * s, which may have moved. Good for gradually accumulating output * into a string buffer. **/ char *talloc_asprintf_append(TALLOC_CTX *t, char *s, const char *fmt, ...) { va_list ap; va_start(ap, fmt); s = talloc_vasprintf_append(t, s, fmt, ap); va_end(ap); return s; }
/****************************************************************************** * tpr *****************************************************************************/ bool tpr (char** s, const char* fmt, ...) { if (s == NULL) return false; // ----------> va_list ap; va_start (ap, fmt); *s = talloc_vasprintf_append (*s, fmt, ap); va_end (ap); return (*s != NULL); }