kolibrios/programs/develop/libraries/kolibri-libc/source/stdio/vprintf.c
turbocat 728f124678 Added git source kolibri-libc and
Configured autobuild

git-svn-id: svn://kolibrios.org@8687 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-04-27 16:33:31 +00:00

27 lines
533 B
C

/* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "conio.h"
#include <sys/ksys.h>
#include <errno.h>
#include <limits.h>
//#include "format_print.h"
int vprintf ( const char * format, va_list arg )
{
int len = 0;
char *s = malloc(STDIO_MAX_MEM);
if(!s){
errno = ENOMEM;
return errno;
}
__con_init();
len = vsnprintf(s, STDIO_MAX_MEM, format, arg);
__con_write_string(s, len);
free(s);
return(len);
}