Update netdev.c
This commit is contained in:
parent
2c964b5bd4
commit
963f35e96d
|
@ -78,7 +78,7 @@ int netdev_register(struct netdev *netdev, const char *name, void *user_data)
|
|||
netdev->addr_callback = RT_NULL;
|
||||
|
||||
/* fill network interface device */
|
||||
rt_strncpy(netdev->name, name, rt_strlen(name));
|
||||
rt_strncpy(netdev->name, name, RT_NAME_MAX);
|
||||
netdev->user_data = user_data;
|
||||
|
||||
/* initialize current network interface device single list */
|
||||
|
@ -260,7 +260,7 @@ struct netdev *netdev_get_by_name(const char *name)
|
|||
for (node = &(netdev_list->list); node; node = rt_slist_next(node))
|
||||
{
|
||||
netdev = rt_slist_entry(node, struct netdev, list);
|
||||
if (netdev && (rt_strncmp(netdev->name, name, rt_strlen(netdev->name)) == 0))
|
||||
if (netdev && (rt_strncmp(netdev->name, name, RT_NAME_MAX) == 0))
|
||||
{
|
||||
rt_hw_interrupt_enable(level);
|
||||
return netdev;
|
||||
|
|
Loading…
Reference in New Issue