Author: pschweitzer
Date: Sun Oct 25 09:28:57 2015
New Revision: 69683
URL:
http://svn.reactos.org/svn/reactos?rev=69683&view=rev
Log:
[CRT]
Fix NTDLL implementation of mbstowcs() and wcstombs() so that they return length in
caracters and not in bytes.
This fixes last failing *to* CRT apitests
CORE-10390
Modified:
trunk/reactos/lib/sdk/crt/string/mbstowcs_nt.c
trunk/reactos/lib/sdk/crt/string/wcstombs_nt.c
Modified: trunk/reactos/lib/sdk/crt/string/mbstowcs_nt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/mbstowc…
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/mbstowcs_nt.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/mbstowcs_nt.c [iso-8859-1] Sun Oct 25 09:28:57 2015
@@ -49,7 +49,7 @@
mbstr,
Length);
- return (size_t)Size;
+ return (size_t)(Size / sizeof(wchar_t));
}
Status = RtlMultiByteToUnicodeN (wcstr,
@@ -60,7 +60,7 @@
if (!NT_SUCCESS(Status))
return -1;
- return (size_t)Size;
+ return (size_t)(Size / sizeof(wchar_t));;
}
/* EOF */
Modified: trunk/reactos/lib/sdk/crt/string/wcstombs_nt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/wcstomb…
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/wcstombs_nt.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/wcstombs_nt.c [iso-8859-1] Sun Oct 25 09:28:57 2015
@@ -40,7 +40,7 @@
(wchar_t*)((size_t)wcstr),
Length * sizeof(WCHAR));
- return (size_t)Size;
+ return (size_t)(Size / sizeof(char));
}
Status = RtlUnicodeToMultiByteN (mbstr,
@@ -51,7 +51,7 @@
if (!NT_SUCCESS(Status))
return -1;
- return (size_t)Size;
+ return (size_t)(Size / sizeof(char));
}
/* EOF */