using namespace CorUnix;
+static const char __nullstring[] = "(null)"; /* string to print on null ptr */
+static const WCHAR __wnullstring[] = W("(null)"); /* string to print on null ptr */
+
int CoreVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const char *format, va_list ap);
int CoreVfwprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const wchar_16 *format, va_list ap);
- padding style flags (PRINTF_FORMAT_FLAGS)
*******************************************************************************/
-INT Internal_AddPaddingVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, LPSTR In,
+INT Internal_AddPaddingVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, LPCSTR In,
INT Padding, INT Flags)
{
LPSTR Out;
{
CHAR TempBuff[1024]; /* used to hold a single %<foo> format string */
LPCWSTR Fmt = format;
- LPWSTR TempWStr = NULL;
+ LPCWSTR TempWStr = NULL;
+ LPWSTR AllocedTempWStr = NULL;
LPWSTR WorkingWStr = NULL;
WCHAR TempWChar[2];
INT Flags;
INT Prefix;
INT Type;
INT TempInt;
- BOOL WStrWasMalloced = FALSE;
int mbtowcResult;
int written=0;
int paddingReturnValue;
(Type == PFF_TYPE_STRING || Type == PFF_TYPE_WSTRING)) ||
(Type == PFF_TYPE_WSTRING && (Flags & PFF_ZERO) != 0))
{
- WStrWasMalloced = FALSE;
+ AllocedTempWStr = NULL;
if (WIDTH_STAR == Width)
{
else
{
/* %lS assumes a LPSTR argument. */
- LPSTR s = va_arg(ap, LPSTR );
- UINT Length = 0;
- Length = MultiByteToWideChar( CP_ACP, 0, s, -1, NULL, 0 );
- if ( Length != 0 )
+ LPCSTR s = va_arg(ap, LPSTR );
+ if (s == NULL)
+ {
+ TempWStr = NULL;
+ }
+ else
{
- TempWStr =
- (LPWSTR)InternalMalloc( (Length) * sizeof( WCHAR ) );
- if ( TempWStr )
+ UINT Length = 0;
+ Length = MultiByteToWideChar( CP_ACP, 0, s, -1, NULL, 0 );
+ if ( Length != 0 )
{
- WStrWasMalloced = TRUE;
- MultiByteToWideChar( CP_ACP, 0, s, -1,
- TempWStr, Length );
+ AllocedTempWStr =
+ (LPWSTR)InternalMalloc( (Length) * sizeof( WCHAR ) );
+
+ if ( AllocedTempWStr )
+ {
+ MultiByteToWideChar( CP_ACP, 0, s, -1,
+ AllocedTempWStr, Length );
+ TempWStr = AllocedTempWStr;
+ }
+ else
+ {
+ ERROR( "InternalMalloc failed.\n" );
+ LOGEXIT("vfwprintf returns int -1\n");
+ PERF_EXIT(vfwprintf);
+ va_end(ap);
+ return -1;
+ }
}
else
{
- ERROR( "InternalMalloc failed.\n" );
+ ASSERT( "Unable to convert from multibyte "
+ " to wide char.\n" );
LOGEXIT("vfwprintf returns int -1\n");
PERF_EXIT(vfwprintf);
va_end(ap);
return -1;
}
}
- else
- {
- ASSERT( "Unable to convert from multibyte "
- " to wide char.\n" );
- LOGEXIT("vfwprintf returns int -1\n");
- PERF_EXIT(vfwprintf);
- va_end(ap);
- return -1;
- }
+ }
+
+ if (TempWStr == NULL)
+ {
+ TempWStr = __wnullstring;
}
INT Length = PAL_wcslen(TempWStr);
LOGEXIT("vfwprintf returns int -1\n");
PERF_EXIT(vfwprintf);
pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- if (WStrWasMalloced)
- {
- free(TempWStr);
- }
+ free(AllocedTempWStr);
va_end(ap);
return -1;
}
if (wcsncpy_s(WorkingWStr, (Length + 1), TempWStr, Precision+1) != SAFECRT_SUCCESS)
{
ERROR("Internal_AddPaddingVfwprintf failed\n");
- if (WStrWasMalloced)
- {
- free(TempWStr);
- }
+ free(AllocedTempWStr);
free(WorkingWStr);
LOGEXIT("wcsncpy_s failed!\n");
PERF_EXIT(vfwprintf);
if (paddingReturnValue == -1)
{
ERROR("Internal_AddPaddingVfwprintf failed\n");
- if (WStrWasMalloced)
- {
- free(TempWStr);
- }
+ free(AllocedTempWStr);
free(WorkingWStr);
LOGEXIT("vfwprintf returns int -1\n");
PERF_EXIT(vfwprintf);
written += paddingReturnValue;
free(WorkingWStr);
- if (WStrWasMalloced)
- {
- free(TempWStr);
- }
+ free(AllocedTempWStr);
}
else if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_CHAR)
{
{
CHAR TempBuff[1024]; /* used to hold a single %<foo> format string */
LPCSTR Fmt = format;
- LPWSTR TempWStr;
+ LPCWSTR TempWStr;
LPSTR TempStr;
WCHAR TempWChar;
INT Flags;
}
TempWStr = va_arg(ap, LPWSTR);
+ if (TempWStr == NULL)\
+ {
+ TempWStr = __wnullstring;
+ }
Length = WideCharToMultiByte(CP_ACP, 0, TempWStr, -1, 0,
0, 0, 0);
if (!Length)
{
// Some versions of fprintf don't support 0-padded strings,
// so we handle them here.
- char *tempStr;
+ const char *tempStr;
tempStr = va_arg(ap, char *);
+ if (tempStr == NULL)
+ {
+ tempStr = __nullstring;
+ }
Length = strlen(tempStr);
paddingReturnValue = Internal_AddPaddingVfprintf(
pthrCurrent,
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+ DoWStrTest(convert("foo %s"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hs"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ws"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %Ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %I64s"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+ DoStrTest(convert("foo %S"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %lS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %wS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %LS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %I64S"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+ DoWStrTest(convert("foo %s"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hs"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ws"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %Ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %I64s"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+ DoStrTest(convert("foo %S"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %lS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %wS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %LS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %I64S"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest(convert("foo %5.2s"), convert("bar"), "foo ba");
DoWStrTest(convert("foo %-5s"), convert("bar"), "foo bar ");
DoWStrTest(convert("foo %05s"), convert("bar"), "foo 00bar");
+ DoWStrTest(convert("foo %s"), NULL, "foo (null)");
+ DoStrTest(convert("foo %hs"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %ls"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %ws"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %Ls"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %I64s"), NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoStrTest(convert("foo %5.2S"),"bar", "foo ba");
DoStrTest(convert("foo %-5S"), "bar", "foo bar ");
DoStrTest(convert("foo %05S"), "bar", "foo 00bar");
+ DoStrTest(convert("foo %S"), NULL, "foo (null)");
+ DoStrTest(convert("foo %hS"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %lS"), NULL, "foo (null)");
+ DoWStrTest(convert("foo %wS"), NULL, "foo (null)");
+ DoStrTest(convert("foo %LS"), NULL, "foo (null)");
+ DoStrTest(convert("foo %I64S"), NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+ DoWStrTest(convert("foo %s"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hs"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ws"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %Ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %I64s"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest(convert("foo %5.2S"),"bar", convert("foo ba"));
DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+ DoStrTest(convert("foo %S"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %lS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %wS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %LS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %I64S"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
}
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoStrTest("foo %ls", NULL, "foo (null)");
+ DoStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoStrTest("foo %5.2s", "bar", "foo ba");
DoStrTest("foo %-5s", "bar", "foo bar ");
DoStrTest("foo %05s", "bar", "foo 00bar");
+ DoStrTest("foo %s", NULL, "foo (null)");
+ DoStrTest("foo %hs", NULL, "foo (null)");
+ DoWStrTest("foo %ls", NULL, "foo (null)");
+ DoWStrTest("foo %ws", NULL, "foo (null)");
+ DoStrTest("foo %Ls", NULL, "foo (null)");
+ DoStrTest("foo %I64s", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+ DoWStrTest("foo %S", NULL, "foo (null)");
+ DoStrTest("foo %hS", NULL, "foo (null)");
+ DoWStrTest("foo %lS", NULL, "foo (null)");
+ DoWStrTest("foo %wS", NULL, "foo (null)");
+ DoWStrTest("foo %LS", NULL, "foo (null)");
+ DoWStrTest("foo %I64S", NULL, "foo (null)");
PAL_Terminate();
return PASS;
DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+ DoWStrTest(convert("foo %s"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hs"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %ws"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %Ls"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %I64s"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+ DoStrTest(convert("foo %S"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %hS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %lS"), NULL, convert("foo (null)"));
+ DoWStrTest(convert("foo %wS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %LS"), NULL, convert("foo (null)"));
+ DoStrTest(convert("foo %I64S"), NULL, convert("foo (null)"));
PAL_Terminate();
return PASS;
DoStrTest(u"foo %5.2s", u"bar", u"foo ba");
DoStrTest(u"foo %-5s", u"bar", u"foo bar ");
DoStrTest(u"foo %05s", u"bar", u"foo 00bar");
+ DoStrTest(u"foo %s", NULL, u"foo (null)");
+ DoStrTest(u"foo %hs", NULL, u"foo (null)");
+ DoStrTest(u"foo %ls", NULL, u"foo (null)");
+ DoStrTest(u"foo %ws", NULL, u"foo (null)");
+ DoStrTest(u"foo %Ls", NULL, u"foo (null)");
+ DoStrTest(u"foo %I64s", NULL, u"foo (null)");
PAL_Terminate();
return PASS;