Author: jimtabor
Date: Tue Jul 12 20:06:30 2016
New Revision: 71906
URL:
http://svn.reactos.org/svn/reactos?rev=71906&view=rev
Log:
[Win32SS]
- Update (Sync/Port) User32:Text to Wine Staging 1.9.11, see CORE-11368.
Modified:
trunk/reactos/win32ss/user/rtl/text.c
trunk/reactos/win32ss/user/user32/windows/text.c
Modified: trunk/reactos/win32ss/user/rtl/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/rtl/text.c?re…
==============================================================================
--- trunk/reactos/win32ss/user/rtl/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/rtl/text.c [iso-8859-1] Tue Jul 12 20:06:30 2016
@@ -1189,7 +1189,7 @@
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;
}
Modified: trunk/reactos/win32ss/user/user32/windows/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/text.c [iso-8859-1] Tue Jul 12 20:06:30
2016
@@ -203,7 +203,7 @@
WINAPI
CharToOemA(LPCSTR s, LPSTR d)
{
- if (!s || !d) return TRUE;
+ if (!s || !d) return FALSE;
return CharToOemBuffA(s, d, strlen(s) + 1);
}
@@ -215,6 +215,8 @@
CharToOemBuffA(LPCSTR s, LPSTR d, DWORD len)
{
WCHAR* bufW;
+
+ if ( !s || !d ) return FALSE;
bufW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (bufW) {
@@ -233,7 +235,7 @@
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 @@
WINAPI
CharToOemW(LPCWSTR s, LPSTR d)
{
+ if ( !s || !d ) return FALSE;
return CharToOemBuffW(s, d, wcslen(s) + 1);
}
@@ -420,6 +423,7 @@
WINAPI
OemToCharA(LPCSTR s, LPSTR d)
{
+ if ( !s || !d ) return FALSE;
return OemToCharBuffA(s, d, strlen(s) + 1);
}
@@ -429,6 +433,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) {
@@ -446,6 +452,7 @@
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 @@
*/
BOOL WINAPI OemToCharW(LPCSTR s, LPWSTR d)
{
+ if ( !s || !d ) return FALSE;
return OemToCharBuffW(s, d, strlen(s) + 1);
}