diff options
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/bootp_subr.c | 7 | ||||
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index b6947ca..ca64638 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1,4 +1,4 @@ -/* $Id: bootp_subr.c,v 1.15 1998/08/23 03:07:16 wollman Exp $ */ +/* $Id: bootp_subr.c,v 1.16 1998/12/03 20:28:23 dillon Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -774,7 +774,8 @@ bootpc_init(void) bzero(&ireq, sizeof(ireq)); for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link)) { - sprintf(ireq.ifr_name, "%s%d", ifp->if_name, ifp->if_unit); + snprintf(ireq.ifr_name, sizeof(ireq.ifr_name), + "%s%d", ifp->if_name, ifp->if_unit); #ifdef BOOTP_WIRED_TO if (strcmp(ireq.ifr_name, __XSTRING(BOOTP_WIRED_TO)) == 0) break; @@ -885,7 +886,7 @@ bootpc_init(void) myaddr.sin_addr = reply.yiaddr; ip = ntohl(myaddr.sin_addr.s_addr); - sprintf(lookup_path,"swap.%d.%d.%d.%d", + snprintf(lookup_path, sizeof(lookup_path), "swap.%d.%d.%d.%d", ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 ); printip("My ip address",myaddr.sin_addr); diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index eb379b5..cc4775b 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.77 1998/09/29 23:15:53 mckusick Exp $ + * $Id: nfs_vfsops.c,v 1.78 1998/10/31 15:31:26 peter Exp $ */ #include <sys/param.h> @@ -486,7 +486,7 @@ nfs_mountroot(mp) nd->root_args.fh = nd->root_fh; nd->root_args.fhsize = nd->root_fhsize; l = ntohl(nd->root_saddr.sin_addr.s_addr); - sprintf(buf,"%ld.%ld.%ld.%ld:%s", + snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", (l >> 24) & 0xff, (l >> 16) & 0xff, (l >> 8) & 0xff, (l >> 0) & 0xff,nd->root_hostnam); printf("NFS ROOT: %s\n",buf); @@ -512,7 +512,7 @@ nfs_mountroot(mp) nd->swap_args.fh = nd->swap_fh; nd->swap_args.fhsize = nd->swap_fhsize; l = ntohl(nd->swap_saddr.sin_addr.s_addr); - sprintf(buf,"%ld.%ld.%ld.%ld:%s", + snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", (l >> 24) & 0xff, (l >> 16) & 0xff, (l >> 8) & 0xff, (l >> 0) & 0xff,nd->swap_hostnam); printf("NFS SWAP: %s\n",buf); |