Author: dchapyshev
Date: Sun Sep 18 20:11:05 2016
New Revision: 72733

URL: http://svn.reactos.org/svn/reactos?rev=72733&view=rev
Log:
[KERNEL32] Add missed type-casting

* Fixes 28 tests for kernel32:codepage

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/string/nls.c?rev=72733&r1=72732&r2=72733&view=diff
==============================================================================
--- 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] 
Sun Sep 18 20:11:05 2016
@@ -476,7 +476,7 @@
 
             while (TempString < MbsEnd)
             {
-                DBCSOffset = CodePageTable->DBCSOffsets[*TempString];
+                DBCSOffset = CodePageTable->DBCSOffsets[(UCHAR)*TempString];
 
                 if (DBCSOffset)
                 {
@@ -487,7 +487,7 @@
                         return 0;
                     }
 
-                    WideChar = CodePageTable->DBCSOffsets[*(TempString + 1) + 
DBCSOffset];
+                    WideChar = CodePageTable->DBCSOffsets[DBCSOffset + 
*(TempString + 1)];
 
                     if (WideChar == CodePageTable->UniDefaultChar &&
                         MAKEWORD(*(TempString + 1), *TempString) != 
CodePageTable->TransUniDefaultChar)
@@ -500,7 +500,7 @@
                 }
                 else
                 {
-                    USHORT WideChar = MultiByteTable[(UCHAR)*TempString];
+                    WideChar = MultiByteTable[(UCHAR)*TempString];
 
                     if ((WideChar == CodePageTable->UniDefaultChar &&
                         *TempString != CodePageTable->TransUniDefaultChar) ||
@@ -568,7 +568,7 @@
 
         return Count;
     }
-    else /* Not DBCS code page */
+    else /* SBCS code page */
     {
         /* Check for invalid characters. */
         if (Flags & MB_ERR_INVALID_CHARS)
@@ -609,7 +609,7 @@
             SetLastError(ERROR_INSUFFICIENT_BUFFER);
             return 0;
         }
-           return MultiByteCount;
+        return MultiByteCount;
     }
 }
 


Reply via email to