目前在使用的最新的webclient.c文件时,编译后遇到rt_strcpy未定义的问题。
之前的版本中还没有使用这个rt_strcpy,但是在最新的版本使用了,就报错了
之前的版本
/* resolve port */
port_ptr = rt_strstr(host_addr + host_addr_len, ":");
if (port_ptr && path_ptr && (port_ptr < path_ptr))
{
int port_len = path_ptr - port_ptr - 1;
rt_strncpy(port_str, port_ptr + 1, port_len);
port_str[port_len] = '\0';
}
if (port_ptr && (!path_ptr))
{
strcpy(port_str, port_ptr + 1);
}
/* ipv4 or domain. */
最新的版本
/* resolve port */
port_ptr = rt_strstr(host_addr + host_addr_len, ":");
if (port_ptr && (!path_ptr || (port_ptr < path_ptr)))
{
if (!path_ptr)
{
rt_strcpy(port_str, port_ptr + 1); //就是这句出的问题
}
else
{
int port_len = path_ptr - port_ptr - 1;
rt_strncpy(port_str, port_ptr + 1, port_len);
port_str[port_len] = '\0';
}
}
else
{
port_ptr = RT_NULL;
}
if (port_ptr && (!path_ptr))
{
strcpy(port_str, port_ptr + 1); //但是这个又没有使用rt_strcpy
}
/* ipv4 or domain. */
目前是直接用strcpy。
不知道作者在更新的时候有没有编译,应该一编译就会发现的问题吧,希望作者能修改一下,或者应该怎么反馈给作者,目前我只能发在论坛、
@bernard 这个我已经提pr了 还在挂着