提交 ebe9fc57 编写于 作者: mysterywolf's avatar mysterywolf 提交者: Bernard Xiong

[kservice] fix the problem of rt_strlen crashed in win32

上级 8213bbd9
......@@ -461,7 +461,17 @@ RTM_EXPORT(rt_strncpy);
*/
char *rt_strcpy(char *dst, const char *src)
{
return rt_strncpy(dst, src, (rt_size_t)-1);
char *dest = dst;
while (*src != '\0')
{
*dst = *src;
dst++;
src++;
}
*dst = '\0';
return dest;
}
RTM_EXPORT(rt_strcpy);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册