The following lines of code running with Visual Studio 2013:
wchar_t test[] = L"\xffff";
wchar_t buf[100];
int ret = swprintf(&buf[0], 100, L"%ls", &test[0]);
It compiles successfully, but swprintf fails to output this character (res is -1). It's ok with any other character except \xffff. This character can be in any position of the string, and swprintf still fails. What's the problem?