vsprintf.c 521 B

1234567891011121314151617181920212223242526
  1. /*
  2. * vsprintf - print formatted output without ellipsis on an array
  3. */
  4. /* $Id$ */
  5. #include <stdio.h>
  6. #include <stdarg.h>
  7. #include "loc_incl.h"
  8. int
  9. vsprintf(char *s, const char *format, va_list arg)
  10. {
  11. int retval;
  12. FILE tmp_stream;
  13. tmp_stream._fd = -1;
  14. tmp_stream._flags = _IOWRITE + _IONBF + _IOWRITING;
  15. tmp_stream._buf = (unsigned char *) s;
  16. tmp_stream._ptr = (unsigned char *) s;
  17. tmp_stream._count = 32767;
  18. retval = _doprnt(format, arg, &tmp_stream);
  19. putc('\0',&tmp_stream);
  20. return retval;
  21. }