Subversion Repositories Kolibri OS

Rev

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

  1. /* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
  2.  
  3. #include <stdarg.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7. #include "conio.h"
  8. #include <sys/ksys.h>
  9. #include <errno.h>
  10. #include <limits.h>
  11. //#include "format_print.h"
  12.  
  13. int vprintf ( const char * format, va_list arg )
  14. {
  15.   int len = 0;
  16.   char *s = malloc(STDIO_MAX_MEM);
  17.   if(!s){
  18.     errno = ENOMEM;
  19.     return errno;
  20.   }
  21.   __con_init();
  22.   len = vsnprintf(s, STDIO_MAX_MEM, format, arg);
  23.   __con_write_string(s, len);
  24.   free(s);
  25.   return(len);
  26. }
  27.