[kservice] fix the problem of rt_strlen crashed in win32

This commit is contained in:
Meco Man 2022-01-08 17:55:46 -05:00 committed by Bernard Xiong
parent 8213bbd92e
commit ebe9fc5771
1 changed files with 11 additions and 1 deletions

View File

@ -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);