Skip to content

Commit e583b6c

Browse files
EvlersRbb666
authored andcommitted
[lwip][ppp]: replace strncpy with rt_strncpy
1 parent c191ad8 commit e583b6c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

  • components/net/lwip
    • lwip-2.0.3/src/netif/ppp
    • lwip-2.1.2/src/netif/ppp

components/net/lwip/lwip-2.0.3/src/netif/ppp/ppp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ static void ppp_do_connect(void *arg) {
454454
* ppp_netif_init_cb - netif init callback
455455
*/
456456
static err_t ppp_netif_init_cb(struct netif *netif) {
457-
netif->name[0] = 'p';
458-
netif->name[1] = 'p';
457+
rt_strncpy(netif->name, "pp", sizeof(netif->name));
459458
#if LWIP_IPV4
460459
/* FIXME: change that when netif_null_output_ip4() will materialize */
461460
netif->output = ppp_netif_output_ip4;

components/net/lwip/lwip-2.1.2/src/netif/ppp/ppp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static void ppp_do_connect(void *arg) {
469469
* ppp_netif_init_cb - netif init callback
470470
*/
471471
static err_t ppp_netif_init_cb(struct netif *netif) {
472-
strncpy(netif->name, "pp", sizeof(netif->name));
472+
rt_strncpy(netif->name, "pp", sizeof(netif->name));
473473
#if PPP_IPV4_SUPPORT
474474
netif->output = ppp_netif_output_ip4;
475475
#endif /* PPP_IPV4_SUPPORT */

0 commit comments

Comments
 (0)