未验证 提交 4535352c 编写于 作者: O openharmony_ci 提交者: Gitee

!984 Optimize strncat

Merge pull request !984 from 李涛/strncat
......@@ -2207,6 +2207,7 @@ musl_src_porting_file = [
"src/env/getenv.c",
"src/string/strcasecmp.c",
"src/string/strncasecmp.c",
"src/string/strncat.c",
"src/string/stpncpy.c",
"src/string/strncpy.c",
"src/string/strcspn.c",
......
#include <string.h>
char *strncat(char *restrict d, const char *restrict s, size_t n)
{
char *a = d;
while (*d != 0) d++;
while (n && *s) n--, *d++ = *s++;
*d++ = 0;
return a;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册