[kservice] fix the problem of rt_strlen crashed in win32
@@ -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);
