Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. //#include "format_scan.h"
  2. #include <stdlib.h>
  3. #include <errno.h>
  4.  
  5. int scanf ( const char * format, ...)
  6. {
  7.    va_list arg;
  8.    int  n;
  9.    va_start(arg, format);
  10.  
  11.    if(__scanf_buffer == NULL) __scanf_buffer = malloc(STDIO_MAX_MEM);
  12.    if(__scanf_buffer == NULL) errno = ENOMEM; return ENOMEM;
  13.  
  14.    *__scanf_buffer = 0;
  15.    n = vscanf(format, arg);
  16.  
  17.    va_end(arg);
  18.    return n;
  19. }
  20.  
  21.  
  22.