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

!944 优化strcspn函数

Merge pull request !944 from fangting/master
......@@ -2202,6 +2202,7 @@ musl_src_porting_file = [
"src/env/getenv.c",
"src/string/stpncpy.c",
"src/string/strncpy.c",
"src/string/strcspn.c",
"src/thread/pthread_once.c",
"src/thread/pthread_cancel.c",
"src/mq/mq_notify.c",
......
// from openbsd, will be rectified later
#include <string.h>
size_t strcspn(const char *string1, const char *string2)
{
const char *a, *p;
char sc, c;
for (a = string1;;) {
sc = *a++;
p = string2;
do {
if ((c = *p++) == sc)
return (a - 1 - string1);
} while (c != 0);
}
/* NOTREACHED */
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册