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

svn path=/trunk/; revision=69683
This commit is contained in:
Pierre Schweitzer
2015-10-25 09:28:57 +00:00
parent d9674b27cf
commit 6445100f0d
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count)
mbstr,
Length);
return (size_t)Size;
return (size_t)(Size / sizeof(wchar_t));
}
Status = RtlMultiByteToUnicodeN (wcstr,
@@ -60,7 +60,7 @@ size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count)
if (!NT_SUCCESS(Status))
return -1;
return (size_t)Size;
return (size_t)(Size / sizeof(wchar_t));;
}
/* EOF */
+2 -2
View File
@@ -40,7 +40,7 @@ size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
(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 @@ size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
if (!NT_SUCCESS(Status))
return -1;
return (size_t)Size;
return (size_t)(Size / sizeof(char));
}
/* EOF */