diff options
author | brian <brian@FreeBSD.org> | 1997-12-23 22:38:55 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-12-23 22:38:55 +0000 |
commit | 24138e024fe13d912a174a8e0e784bf1a1e0a29d (patch) | |
tree | cce9d71a4b4a1baea1557e670c6c8e497c76b237 /usr.sbin/ppp/arp.c | |
parent | 9672a80ab32ce23bfa528d665a4d62625db2e8a6 (diff) | |
download | FreeBSD-src-24138e024fe13d912a174a8e0e784bf1a1e0a29d.zip FreeBSD-src-24138e024fe13d912a174a8e0e784bf1a1e0a29d.tar.gz |
strncpy(x,y,sizeof(x)) --> strncpy(x,y,sizeof(x)-1)
Suggested by: Philippe Charnier <charnier@lirmm.fr>
Theo de Raadt <deraadt@cvs.openbsd.org>
Diffstat (limited to 'usr.sbin/ppp/arp.c')
-rw-r--r-- | usr.sbin/ppp/arp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c index dc9c7f3..d089e7c 100644 --- a/usr.sbin/ppp/arp.c +++ b/usr.sbin/ppp/arp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: arp.c,v 1.17 1997/11/09 06:22:38 brian Exp $ + * $Id: arp.c,v 1.18 1997/11/22 03:37:22 brian Exp $ * */ @@ -244,7 +244,7 @@ get_ether_addr(int s, u_long ipaddr, struct sockaddr_dl *hwaddr) for (ifr = ifc.ifc_req; ifr < ifend;) { if (ifr->ifr_addr.sa_family == AF_INET) { ina = ((struct sockaddr_in *) & ifr->ifr_addr)->sin_addr.s_addr; - strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); + strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name) - 1); ifreq.ifr_name[sizeof(ifreq.ifr_name) - 1] = '\0'; /* |