/* add_bufferf() add the formatted input to the buffer.  */
CURLcode Curl_add_bufferf(Curl_send_buffer **inp, const char *fmt,...)
/* add_bufferf() add the formatted input to the buffer.  */
CURLcode Curl_add_bufferf(Curl_send_buffer **inp, const char *fmt,...)
{
  char *s;
  va_list ap;
  Curl_send_buffer *in = *inp;
  va_start(ap, fmt);
  s = vaprintf(fmt, ap);
  va_end(ap);
  if(s) {
    CURLcode result = Curl_add_buffer(inp, s, strlen(s));
    free(s);
    return result;
  }
  free(in->buffer);
  free(in);
  *inp = NULL;
  return CURLE_OUT_OF_MEMORY;
}