Commit aebe1c69 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Add _mbsnbcpy_s_l implementation.

parent 534394df
...@@ -1132,7 +1132,7 @@ ...@@ -1132,7 +1132,7 @@
@ cdecl _mbsnbcpy(ptr str long) @ cdecl _mbsnbcpy(ptr str long)
@ stub _mbsnbcpy_l @ stub _mbsnbcpy_l
@ cdecl _mbsnbcpy_s(ptr long str long) @ cdecl _mbsnbcpy_s(ptr long str long)
@ stub _mbsnbcpy_s_l @ cdecl _mbsnbcpy_s_l(ptr long str long ptr)
@ cdecl _mbsnbicmp(str str long) @ cdecl _mbsnbicmp(str str long)
@ stub _mbsnbicmp_l @ stub _mbsnbicmp_l
@ cdecl _mbsnbicoll(str str long) @ cdecl _mbsnbicoll(str str long)
......
...@@ -1490,7 +1490,7 @@ ...@@ -1490,7 +1490,7 @@
@ cdecl _mbsnbcpy(ptr str long) @ cdecl _mbsnbcpy(ptr str long)
@ stub _mbsnbcpy_l @ stub _mbsnbcpy_l
@ cdecl _mbsnbcpy_s(ptr long str long) @ cdecl _mbsnbcpy_s(ptr long str long)
@ stub _mbsnbcpy_s_l @ cdecl _mbsnbcpy_s_l(ptr long str long ptr)
@ cdecl _mbsnbicmp(str str long) @ cdecl _mbsnbicmp(str str long)
@ stub _mbsnbicmp_l @ stub _mbsnbicmp_l
@ cdecl _mbsnbicoll(str str long) @ cdecl _mbsnbicoll(str str long)
......
...@@ -804,7 +804,7 @@ ...@@ -804,7 +804,7 @@
@ cdecl _mbsnbcpy(ptr str long) @ cdecl _mbsnbcpy(ptr str long)
@ stub _mbsnbcpy_l @ stub _mbsnbcpy_l
@ cdecl _mbsnbcpy_s(ptr long str long) @ cdecl _mbsnbcpy_s(ptr long str long)
@ stub _mbsnbcpy_s_l @ cdecl _mbsnbcpy_s_l(ptr long str long ptr)
@ cdecl _mbsnbicmp(str str long) @ cdecl _mbsnbicmp(str str long)
@ stub _mbsnbicmp_l @ stub _mbsnbicmp_l
@ cdecl _mbsnbicoll(str str long) @ cdecl _mbsnbicoll(str str long)
......
...@@ -782,7 +782,7 @@ ...@@ -782,7 +782,7 @@
@ cdecl _mbsnbcpy(ptr str long) @ cdecl _mbsnbcpy(ptr str long)
@ stub _mbsnbcpy_l @ stub _mbsnbcpy_l
@ cdecl _mbsnbcpy_s(ptr long str long) @ cdecl _mbsnbcpy_s(ptr long str long)
@ stub _mbsnbcpy_s_l @ cdecl _mbsnbcpy_s_l(ptr long str long ptr)
@ cdecl _mbsnbicmp(str str long) @ cdecl _mbsnbicmp(str str long)
@ stub _mbsnbicmp_l @ stub _mbsnbicmp_l
@ cdecl _mbsnbicoll(str str long) @ cdecl _mbsnbicoll(str str long)
......
...@@ -638,12 +638,13 @@ unsigned char* CDECL _mbsncpy(unsigned char* dst, const unsigned char* src, MSVC ...@@ -638,12 +638,13 @@ unsigned char* CDECL _mbsncpy(unsigned char* dst, const unsigned char* src, MSVC
} }
/********************************************************************* /*********************************************************************
* _mbsnbcpy_s(MSVCRT.@) * _mbsnbcpy_s_l(MSVCRT.@)
* REMARKS * REMARKS
* Unlike _mbsnbcpy this function does not pad the rest of the dest * Unlike _mbsnbcpy this function does not pad the rest of the dest
* string with 0 * string with 0
*/ */
int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned char* src, MSVCRT_size_t n) int CDECL _mbsnbcpy_s_l(unsigned char* dst, MSVCRT_size_t size,
const unsigned char* src, MSVCRT_size_t n, MSVCRT__locale_t locale)
{ {
MSVCRT_size_t pos = 0; MSVCRT_size_t pos = 0;
...@@ -657,7 +658,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -657,7 +658,7 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
if(!n) if(!n)
return 0; return 0;
if(get_mbcinfo()->ismbcodepage) if((locale ? locale->mbcinfo : get_mbcinfo())->ismbcodepage)
{ {
int is_lead = 0; int is_lead = 0;
while (*src && n) while (*src && n)
...@@ -703,6 +704,14 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha ...@@ -703,6 +704,14 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
} }
/********************************************************************* /*********************************************************************
* _mbsnbcpy_s(MSVCRT.@)
*/
int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned char* src, MSVCRT_size_t n)
{
return _mbsnbcpy_s_l(dst, size, src, n, NULL);
}
/*********************************************************************
* _mbsnbcpy(MSVCRT.@) * _mbsnbcpy(MSVCRT.@)
* REMARKS * REMARKS
* Like strncpy this function doesn't enforce the string to be * Like strncpy this function doesn't enforce the string to be
......
...@@ -755,7 +755,7 @@ ...@@ -755,7 +755,7 @@
@ cdecl _mbsnbcpy(ptr str long) @ cdecl _mbsnbcpy(ptr str long)
# stub _mbsnbcpy_l(ptr str long ptr) # stub _mbsnbcpy_l(ptr str long ptr)
@ cdecl _mbsnbcpy_s(ptr long str long) @ cdecl _mbsnbcpy_s(ptr long str long)
# stub _mbsnbcpy_s_l(ptr long str long ptr) @ cdecl _mbsnbcpy_s_l(ptr long str long ptr)
@ cdecl _mbsnbicmp(str str long) @ cdecl _mbsnbicmp(str str long)
# stub _mbsnbicmp_l(str str long ptr) # stub _mbsnbicmp_l(str str long ptr)
@ cdecl _mbsnbicoll(str str long) @ cdecl _mbsnbicoll(str str long)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment