mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:12:59 +00:00
[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 svn path=/trunk/; revision=69683
This commit is contained in:
parent
d9674b27cf
commit
6445100f0d
2 changed files with 4 additions and 4 deletions
|
@ -49,7 +49,7 @@ size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count)
|
||||||
mbstr,
|
mbstr,
|
||||||
Length);
|
Length);
|
||||||
|
|
||||||
return (size_t)Size;
|
return (size_t)(Size / sizeof(wchar_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlMultiByteToUnicodeN (wcstr,
|
Status = RtlMultiByteToUnicodeN (wcstr,
|
||||||
|
@ -60,7 +60,7 @@ size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count)
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (size_t)Size;
|
return (size_t)(Size / sizeof(wchar_t));;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -40,7 +40,7 @@ size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
|
||||||
(wchar_t*)((size_t)wcstr),
|
(wchar_t*)((size_t)wcstr),
|
||||||
Length * sizeof(WCHAR));
|
Length * sizeof(WCHAR));
|
||||||
|
|
||||||
return (size_t)Size;
|
return (size_t)(Size / sizeof(char));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlUnicodeToMultiByteN (mbstr,
|
Status = RtlUnicodeToMultiByteN (mbstr,
|
||||||
|
@ -51,7 +51,7 @@ size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (size_t)Size;
|
return (size_t)(Size / sizeof(char));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue