diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-03 21:16:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-03 21:16:31 +0000 |
commit | 725acc4414e36b669a77770a786b7f9490eff3a3 (patch) | |
tree | 5413c025cb9c943e75923103c2fc48bfbd4414b4 /sys/netns/ns_ip.c | |
parent | 492edca4204c3a1bbefa82cd0298b4bc5044d58c (diff) |
string fixes; tedu ok
Diffstat (limited to 'sys/netns/ns_ip.c')
-rw-r--r-- | sys/netns/ns_ip.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netns/ns_ip.c b/sys/netns/ns_ip.c index a8b70e1f598..dcbc7a8c192 100644 --- a/sys/netns/ns_ip.c +++ b/sys/netns/ns_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ns_ip.c,v 1.15 2002/08/28 15:43:03 pefo Exp $ */ +/* $OpenBSD: ns_ip.c,v 1.16 2003/05/03 21:16:30 deraadt Exp $ */ /* $NetBSD: ns_ip.c,v 1.16 1996/05/09 22:29:40 scottr Exp $ */ /* @@ -93,7 +93,8 @@ nsipattach() if (nsipif.if_mtu == 0) { ifp = &nsipif; - sprintf(ifp->if_xname, "nsip%d", nsipif_unit); + snprintf(ifp->if_xname, sizeof ifp->if_xname, + "nsip%d", nsipif_unit); ifp->if_mtu = LOMTU; ifp->if_ioctl = nsipioctl; ifp->if_output = nsipoutput; @@ -107,7 +108,8 @@ nsipattach() nsip_list = m; ifp = &m->ifen_ifnet; - sprintf(ifp->if_xname, "nsip%d", nsipif_unit++); + snprintf(ifp->if_xname, sizeof ifp->if_xname, + "nsip%d", nsipif_unit++); ifp->if_mtu = LOMTU; ifp->if_ioctl = nsipioctl; ifp->if_output = nsipoutput; @@ -120,7 +122,8 @@ nsipattach() * XXX in the days before if_xname. */ bzero(nsipif.if_xname, sizeof(nsipif.if_xname)); - sprintf(nsipif.if_xname, "nsip%d", nsipif_unit); + snprintf(nsipif.if_xname, sizeof nsipif.if_xname, + "nsip%d", nsipif_unit); return (m); } @@ -395,7 +398,8 @@ nsip_route(m) * now configure this as a point to point link */ bzero(ifr.ifr_name, sizeof(ifr.ifr_name)); - sprintf(ifr.ifr_name, "nsip%d", nsipif_unit - 1); + snprintf(ifr.ifr_name, sizeof ifr.ifr_name, + "nsip%d", nsipif_unit - 1); ifr.ifr_dstaddr = *snstosa(ns_dst); (void)ns_control((struct socket *)0, SIOCSIFDSTADDR, (caddr_t)&ifr, (struct ifnet *)ifn); |