From 3b0fb2b175f96ba8e2c20e80be27ee348fc7547c Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 22 Jul 2020 11:10:42 +0200 Subject: [PATCH] msvcrt: Copy strncat implementation from ntdll. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/string.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index f646cee9dfd..9e747a1a0c7 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -1171,7 +1171,11 @@ int CDECL MSVCRT_strncat_s( char* dst, MSVCRT_size_t elem, const char* src, MSVC */ char* __cdecl MSVCRT_strncat(char *dst, const char *src, MSVCRT_size_t len) { - return strncat(dst, src, len); + char *d = dst; + while (*d) d++; + for ( ; len && *src; d++, src++, len--) *d = *src; + *d = 0; + return dst; } /*********************************************************************