kill sprintf.

This commit is contained in:
christos 2014-03-25 16:30:28 +00:00
parent d22061e092
commit 66873a203c
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_clvnops.c,v 1.1.1.1 2013/09/30 07:19:20 dholland Exp $ */
/* $NetBSD: nfs_clvnops.c,v 1.2 2014/03/25 16:30:28 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -35,7 +35,7 @@
#include <sys/cdefs.h>
/* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 252072 2013-06-21 22:26:18Z rmacklem "); */
__RCSID("$NetBSD: nfs_clvnops.c,v 1.1.1.1 2013/09/30 07:19:20 dholland Exp $");
__RCSID("$NetBSD: nfs_clvnops.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
/*
* vnode op calls for Sun NFS version 2, 3 and 4
@ -2428,7 +2428,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
pid = cnp->cn_thread->td_proc->p_pid;
lticks = (unsigned int)ticks;
for ( ; ; ) {
sp->s_namlen = sprintf(sp->s_name,
sp->s_namlen = snprintf(sp->s_name, sizeof(sp->s_name),
".nfs.%08x.%04x4.4", lticks,
pid);
if (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_nfsdkrpc.c,v 1.1.1.1 2013/09/30 07:19:53 dholland Exp $ */
/* $NetBSD: nfs_nfsdkrpc.c,v 1.2 2014/03/25 16:30:28 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
/* __FBSDID("FreeBSD: head/sys/fs/nfsserver/nfs_nfsdkrpc.c 249596 2013-04-17 22:42:43Z ken "); */
__RCSID("$NetBSD: nfs_nfsdkrpc.c,v 1.1.1.1 2013/09/30 07:19:53 dholland Exp $");
__RCSID("$NetBSD: nfs_nfsdkrpc.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
#include "opt_inet6.h"
#include "opt_kgssapi.h"
@ -179,7 +179,7 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt)
#if defined(KLD_MODULE)
/* Do not use ip6_sprintf: the nfs module should work without INET6. */
#define ip6_sprintf(buf, a) \
(sprintf((buf), "%x:%x:%x:%x:%x:%x:%x:%x", \
(snprintf((buf), sizeof(buf), "%x:%x:%x:%x:%x:%x:%x:%x", \
(a)->s6_addr16[0], (a)->s6_addr16[1], \
(a)->s6_addr16[2], (a)->s6_addr16[3], \
(a)->s6_addr16[4], (a)->s6_addr16[5], \

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_nfsdserv.c,v 1.1.1.1 2013/09/30 07:19:55 dholland Exp $ */
/* $NetBSD: nfs_nfsdserv.c,v 1.2 2014/03/25 16:30:28 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
/* __FBSDID("FreeBSD: head/sys/fs/nfsserver/nfs_nfsdserv.c 245613 2013-01-18 19:42:08Z delphij "); */
__RCSID("$NetBSD: nfs_nfsdserv.c,v 1.1.1.1 2013/09/30 07:19:55 dholland Exp $");
__RCSID("$NetBSD: nfs_nfsdserv.c,v 1.2 2014/03/25 16:30:28 christos Exp $");
/*
* nfs version 2, 3 and 4 server calls to vnode ops
@ -3346,8 +3346,8 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused int isdgram,
rad = NFSSOCKADDR(clp->lc_req.nr_nam, struct sockaddr_in *);
ucp = (u_char *)&rad->sin_addr.s_addr;
ucp2 = (u_char *)&rad->sin_port;
sprintf(addrbuf, "%d.%d.%d.%d.%d.%d", ucp[0] & 0xff,
ucp[1] & 0xff, ucp[2] & 0xff, ucp[3] & 0xff,
snprintf(addrbuf, sizeof(addrbuf), "%d.%d.%d.%d.%d.%d",
ucp[0] & 0xff, ucp[1] & 0xff, ucp[2] & 0xff, ucp[3] & 0xff,
ucp2[0] & 0xff, ucp2[1] & 0xff);
(void) nfsm_strtom(nd, addrbuf, strlen(addrbuf));
}