aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 1fb474925e..b96735e267 100644
--- a/vl.c
+++ b/vl.c
@@ -4446,7 +4446,7 @@ int tap_alloc(char *dev, size_t dev_size)
syslog(LOG_ERR, "Can't get flags\n");
snprintf (actual_name, 32, "tap%d", ppa);
- strncpy (ifr.lifr_name, actual_name, sizeof (ifr.lifr_name));
+ pstrcpy(ifr.lifr_name, sizeof(ifr.lifr_name), actual_name);
ifr.lifr_ppa = ppa;
/* Assign ppa according to the unit number returned by tun device */
@@ -4489,7 +4489,7 @@ int tap_alloc(char *dev, size_t dev_size)
close (if_fd);
memset(&ifr, 0x0, sizeof(ifr));
- strncpy (ifr.lifr_name, actual_name, sizeof (ifr.lifr_name));
+ pstrcpy(ifr.lifr_name, sizeof(ifr.lifr_name), actual_name);
ifr.lifr_ip_muxid = ip_muxid;
ifr.lifr_arp_muxid = arp_muxid;