/* tag: Tom Lord Tue Dec  4 14:41:25 2001 (command.c)
 */
/* command.c -
 *
 ****************************************************************
 * Copyright (C) 2001 Tom Lord
 * 
 * See the file "COPYING" for further information about
 * the copyright and warranty status of this work.
 */


#include "hackerlab/vu/vu-utils.h"
#include "hackerlab/vu/printfmt-va.h"
#include "ftp-utils/clients/ftp-command.h"



int
ftp_client_printfmt (int * errn, int fd, char * fmt, ...)
{
  int answer;
  va_list ap;

#if 0
  printfmt (errn, 2, "sending: ");
  va_start (ap, fmt);
  printfmt_va_list (errn, 2, fmt, ap);
  va_end (ap);
#endif

  va_start (ap, fmt);
  answer = printfmt_va_list (errn, fd, fmt, ap);
  va_end (ap);

  if (   (answer >= 0)
      && vfdbuf_is_buffered (fd)
      && (0 > vfdbuf_flush (errn, fd)))
    return -1;

  return answer;
}

