Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

char* talloc_vasprintf_append ( TALLOC_CTX t,
char *  s,
const char *  fmt,
va_list  ap 
)

Realloc s to append the formatted result of fmt and ap, and return s, which may have moved. Good for gradually accumulating output into a string buffer.

Definition at line 348 of file talloc.c.

References talloc_realloc().

Referenced by talloc_asprintf_append().

{     
      int len, s_len;
      va_list ap2;

      VA_COPY(ap2, ap);
      s_len = strlen(s);
      len = vsnprintf(NULL, 0, fmt, ap2);

      s = talloc_realloc(t, s, s_len + len+1);
      if (!s) return NULL;

      VA_COPY(ap2, ap);
      vsnprintf(s+s_len, len+1, fmt, ap2);

      return s;
}


Generated by  Doxygen 1.6.0   Back to index