X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/23e20b0053d7317ce3facd3fd38db8c73c2c380a..b061a43bf32824cb214e9e3a29a974341de443d4:/locale/FreeBSD/gb18030.c diff --git a/locale/FreeBSD/gb18030.c b/locale/FreeBSD/gb18030.c index 7a5fc78..baeaada 100644 --- a/locale/FreeBSD/gb18030.c +++ b/locale/FreeBSD/gb18030.c @@ -97,7 +97,7 @@ _GB18030_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, } ncopy = MIN(MIN(n, GB18030_MB_CUR_MAX), sizeof(gs->bytes) - gs->count); - memcpy(gs->bytes + gs->count, s, ncopy); + strncpy((char*)(gs->bytes + gs->count), s, ncopy); ocount = gs->count; gs->count += ncopy; s = (char *)gs->bytes;