mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SDK] Do not use a NUL file while calculating format string length
CORE-14342
This commit is contained in:
parent
dedd08c38d
commit
2f548599a4
2 changed files with 10 additions and 19 deletions
|
@ -15,14 +15,9 @@ _vscprintf(
|
|||
const char *format,
|
||||
va_list argptr)
|
||||
{
|
||||
int ret;
|
||||
FILE* nulfile = fopen("nul", "w");
|
||||
if(nulfile == NULL)
|
||||
{
|
||||
/* This should never happen... */
|
||||
return -1;
|
||||
}
|
||||
ret = streamout(nulfile, format, argptr);
|
||||
fclose(nulfile);
|
||||
return ret;
|
||||
FILE nulfile;
|
||||
nulfile._tmpfname = nulfile._ptr = nulfile._base = NULL;
|
||||
nulfile._bufsiz = nulfile._charbuf = nulfile._cnt = 0;
|
||||
nulfile._flag = _IOSTRG | _IOWRT;
|
||||
return streamout(&nulfile, format, argptr);
|
||||
}
|
||||
|
|
|
@ -22,15 +22,11 @@ _vscwprintf(
|
|||
{
|
||||
int ret;
|
||||
#ifndef _LIBCNT_
|
||||
FILE* nulfile;
|
||||
nulfile = fopen("nul", "w");
|
||||
if(nulfile == NULL)
|
||||
{
|
||||
/* This should never happen... */
|
||||
return -1;
|
||||
}
|
||||
ret = wstreamout(nulfile, format, argptr);
|
||||
fclose(nulfile);
|
||||
FILE nulfile;
|
||||
nulfile._tmpfname = nulfile._ptr = nulfile._base = NULL;
|
||||
nulfile._bufsiz = nulfile._charbuf = nulfile._cnt = 0;
|
||||
nulfile._flag = _IOSTRG | _IOWRT;
|
||||
ret = wstreamout(&nulfile, format, argptr);
|
||||
#else
|
||||
ret = -1;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue