Author: khornicek
Date: Mon Mar 16 19:00:57 2015
New Revision: 66742
URL:
http://svn.reactos.org/svn/reactos?rev=66742&view=rev
Log:
[KERNEL32]
- don't garble the output with invalid data in WideCharToUtf7
- fixes whopping 65536 failed tests and as a result Testman shouldn't choke on
kernel32:codepage anymore
Modified:
trunk/reactos/dll/win32/kernel32/winnls/string/nls.c
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] Mon Mar 16 19:00:57
2015
@@ -1654,12 +1654,12 @@
}
*pszUtf7++ = base64[wsz[0] >> 10];
*pszUtf7++ = base64[(wsz[0] >> 4) & 0x3F];
- *pszUtf7++ = base64[(wsz[0] << 2 | wsz[1] >> 14) & 0x3F];
+ *pszUtf7++ = base64[(wsz[0] << 2 | (n >= 2 ? wsz[1] >> 14 :
0)) & 0x3F];
if (n >= 2)
{
*pszUtf7++ = base64[(wsz[1] >> 8) & 0x3F];
*pszUtf7++ = base64[(wsz[1] >> 2) & 0x3F];
- *pszUtf7++ = base64[(wsz[1] << 4 | wsz[2] >> 12) &
0x3F];
+ *pszUtf7++ = base64[(wsz[1] << 4 | (n >= 3 ? wsz[2] >> 12
: 0)) & 0x3F];
if (n >= 3)
{
*pszUtf7++ = base64[(wsz[2] >> 6) & 0x3F];