mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 22:17:17 +00:00
ntdll: Add strcat_s and wcscat_s.
Implementation copied from msvcrt. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
41f488a32d
commit
83cd792e35
|
@ -1587,6 +1587,7 @@
|
|||
@ cdecl sqrt(double)
|
||||
@ varargs sscanf(str str)
|
||||
@ cdecl strcat(str str)
|
||||
@ cdecl strcat_s(str long str)
|
||||
@ cdecl strchr(str long)
|
||||
@ cdecl strcmp(str str)
|
||||
@ cdecl strcpy(ptr str)
|
||||
|
@ -1616,6 +1617,7 @@
|
|||
@ cdecl vsprintf_s(ptr long str ptr)
|
||||
@ cdecl vswprintf_s(ptr long wstr ptr)
|
||||
@ cdecl wcscat(wstr wstr)
|
||||
@ cdecl wcscat_s(wstr long wstr)
|
||||
@ cdecl wcschr(wstr long)
|
||||
@ cdecl wcscmp(wstr wstr)
|
||||
@ cdecl wcscpy(ptr wstr)
|
||||
|
|
|
@ -224,6 +224,26 @@ char * __cdecl strcat( char *dst, const char *src )
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* strcat_s (NTDLL.@)
|
||||
*/
|
||||
errno_t __cdecl strcat_s( char *dst, size_t len, const char *src )
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (!dst || !len) return EINVAL;
|
||||
if (!src)
|
||||
{
|
||||
*dst = 0;
|
||||
return EINVAL;
|
||||
}
|
||||
for (i = 0; i < len; i++) if (!dst[i]) break;
|
||||
for (j = 0; (j + i) < len; j++) if (!(dst[j + i] = src[j])) return 0;
|
||||
*dst = 0;
|
||||
return ERANGE;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* strchr (NTDLL.@)
|
||||
*/
|
||||
|
|
|
@ -204,6 +204,26 @@ LPWSTR __cdecl wcscat( LPWSTR dst, LPCWSTR src )
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* wcscat_s (NTDLL.@)
|
||||
*/
|
||||
errno_t __cdecl wcscat_s( wchar_t *dst, size_t len, const wchar_t *src )
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (!dst || !len) return EINVAL;
|
||||
if (!src)
|
||||
{
|
||||
*dst = 0;
|
||||
return EINVAL;
|
||||
}
|
||||
for (i = 0; i < len; i++) if (!dst[i]) break;
|
||||
for (j = 0; (j + i) < len; j++) if (!(dst[j + i] = src[j])) return 0;
|
||||
*dst = 0;
|
||||
return ERANGE;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* wcschr (NTDLL.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue