Subversion Repositories Kolibri OS

Rev

Go to most recent revision | 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 <limits.h>
  4. #include <libc/file.h>
  5.  
  6. int
  7. sprintf(char *str, const char *fmt, ...)
  8. {
  9.   FILE _strbuf;
  10.   int len;
  11.   va_list va;
  12.   va_start(va, fmt);
  13.  
  14.   _strbuf._flag = _IOWRT|_IOSTRG;
  15.   _strbuf._ptr = str;
  16.   _strbuf._cnt = INT_MAX;
  17.   len = _doprnt(fmt, va, &_strbuf);
  18.   va_end(va);
  19.   *_strbuf._ptr = 0;
  20.   return len;
  21. }
  22.