Subversion Repositories Kolibri OS

Rev

Rev 4973 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3. #include <stdarg.h>
  4. #include <limits.h>
  5. #include <libc/file.h>
  6.  
  7. int
  8. sprintf(char *str, const char *fmt, ...)
  9. {
  10.   FILE _strbuf;
  11.   int len;
  12.   va_list va;
  13.   va_start(va, fmt);
  14.  
  15.   _strbuf._flag = _IOWRT|_IOSTRG;
  16.   _strbuf._ptr = str;
  17.   _strbuf._cnt = INT_MAX;
  18.   len = _doprnt(fmt, va, &_strbuf);
  19.   va_end(va);
  20.   *_strbuf._ptr = 0;
  21.   return len;
  22. }
  23.