mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
Replace uses of strncpy (a GNU extension) with Qemu pstrcpy
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5531 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
9b4c14c35b
commit
be15b141e0
7 changed files with 10 additions and 9 deletions
4
vl.c
4
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue