[Win32SS]
authorJames Tabor <james.tabor@reactos.org>
Tue, 12 Jul 2016 20:06:30 +0000 (20:06 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 12 Jul 2016 20:06:30 +0000 (20:06 +0000)
- Update (Sync/Port) User32:Text to Wine Staging 1.9.11, see CORE-11368.

svn path=/trunk/; revision=71906

reactos/win32ss/user/rtl/text.c
reactos/win32ss/user/user32/windows/text.c

index 9c47a3e..0184b5b 100644 (file)
@@ -1189,7 +1189,7 @@ INT WINAPI DrawTextExWorker( HDC hdc,
 
     if (flags & DT_EXPANDTABS)
     {
-        int tabstop = ((flags & DT_TABSTOP) && dtp) ? dtp->iTabLength : 8;
+        int tabstop = ((flags & DT_TABSTOP) && dtp && dtp->iTabLength) ? dtp->iTabLength : 8;
        tabwidth = tm.tmAveCharWidth * tabstop;
     }
 
index 3d74329..ab9f575 100644 (file)
@@ -203,7 +203,7 @@ BOOL
 WINAPI
 CharToOemA(LPCSTR s, LPSTR d)
 {
-    if (!s || !d) return TRUE;
+    if (!s || !d) return FALSE;
     return CharToOemBuffA(s, d, strlen(s) + 1);
 }
 
@@ -216,6 +216,8 @@ CharToOemBuffA(LPCSTR s, LPSTR d, DWORD len)
 {
     WCHAR* bufW;
 
+    if ( !s || !d ) return FALSE;
+
     bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
     if (bufW) {
            MultiByteToWideChar(CP_ACP, 0, s, len, bufW, len);
@@ -233,7 +235,7 @@ WINAPI
 CharToOemBuffW(LPCWSTR s, LPSTR d, DWORD len)
 {
     if (!s || !d)
-        return TRUE;
+        return FALSE;
     WideCharToMultiByte(CP_OEMCP, 0, s, len, d, len, NULL, NULL);
     return TRUE;
 }
@@ -245,6 +247,7 @@ BOOL
 WINAPI
 CharToOemW(LPCWSTR s, LPSTR d)
 {
+    if ( !s || !d ) return FALSE;
     return CharToOemBuffW(s, d, wcslen(s) + 1);
 }
 
@@ -420,6 +423,7 @@ BOOL
 WINAPI
 OemToCharA(LPCSTR s, LPSTR d)
 {
+    if ( !s || !d ) return FALSE;
     return OemToCharBuffA(s, d, strlen(s) + 1);
 }
 
@@ -430,6 +434,8 @@ BOOL WINAPI OemToCharBuffA(LPCSTR s, LPSTR d, DWORD len)
 {
     WCHAR* bufW;
 
+    if ( !s || !d ) return FALSE;
+
     bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
     if (bufW) {
         MultiByteToWideChar(CP_OEMCP, 0, s, len, bufW, len);
@@ -446,6 +452,7 @@ BOOL
 WINAPI
 OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
 {
+    if ( !s || !d ) return FALSE;
     MultiByteToWideChar(CP_OEMCP, 0, s, len, d, len);
     return TRUE;
 }
@@ -455,6 +462,7 @@ OemToCharBuffW(LPCSTR s, LPWSTR d, DWORD len)
  */
 BOOL WINAPI OemToCharW(LPCSTR s, LPWSTR d)
 {
+    if ( !s || !d ) return FALSE;
     return OemToCharBuffW(s, d, strlen(s) + 1);
 }