mirror of
https://github.com/reactos/reactos.git
synced 2024-09-22 02:30:33 +00:00
406dfdbc87
Sync trunk (rr49606) svn path=/branches/cmake-bringup/; revision=49607
38 lines
805 B
C
38 lines
805 B
C
/*
|
|
* COPYRIGHT: GNU GPL, see COPYING in the top level directory
|
|
* PROJECT: ReactOS crt library
|
|
* FILE: lib/sdk/crt/printf/_vsnprintf.c
|
|
* PURPOSE: Implementation of _vsnprintf
|
|
* PROGRAMMER: Timo Kreuzer
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
int _cdecl streamout(FILE *stream, const char *format, va_list argptr);
|
|
|
|
int
|
|
__cdecl
|
|
_vsnprintf(
|
|
char *buffer,
|
|
size_t count,
|
|
const char *format,
|
|
va_list argptr)
|
|
{
|
|
int result;
|
|
FILE stream;
|
|
|
|
stream._base = buffer;
|
|
stream._ptr = stream._base;
|
|
stream._bufsiz = count;
|
|
stream._cnt = stream._bufsiz;
|
|
stream._flag = _IOSTRG | _IOWRT;
|
|
stream._tmpfname = 0;
|
|
stream._charbuf = 0;
|
|
|
|
result = streamout(&stream, format, argptr);
|
|
*stream._ptr = '\0';
|
|
|
|
return result;
|
|
}
|