summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h')
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h b/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
index 37a379212e..36895d207f 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
@@ -15,13 +15,13 @@
#define __vswprintf_H__
/* These functions leaks memory like crazy. C'est la vie. */
-int testvswp(wchar_t* buf, const wchar_t* format, ...)
+int testvswp(wchar_t* buf, size_t buffSize, const wchar_t* format, ...)
{
int retVal = 0;
va_list arglist;
va_start(arglist, format);
- retVal = vswprintf(buf, format, arglist);
+ retVal = _vsnwprintf_s(buf, buffSize, _TRUNCATE, format, arglist);
va_end(arglist);
return( retVal);
@@ -31,7 +31,7 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, param);
+ testvswp(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
{
@@ -46,7 +46,7 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, param);
+ testvswp(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
{
@@ -61,7 +61,7 @@ void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, param);
+ testvswp(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
{
Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
@@ -75,7 +75,7 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, param);
+ testvswp(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
{
Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
@@ -89,7 +89,7 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, value);
+ testvswp(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
{
Fail("ERROR: failed to insert %#x into \"%s\"\n"
@@ -102,7 +102,7 @@ void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCH
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, value);
+ testvswp(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
{
Fail("ERROR: failed to insert %s into \"%s\"\n"
@@ -115,7 +115,7 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1,
{
WCHAR buf[256] = { 0 };
- testvswp(buf, formatstr, value);
+ testvswp(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
{