diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-07-14 16:54:37 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-07-14 16:54:37 +0000 |
commit | 51cb9c0c86fb97f3733907158934958a74de3579 (patch) | |
tree | 9a29d3687227e3fe8a8400ef803dc6628427be9a /usr.sbin/rpcbind | |
parent | 32905cfb8d193ea3c0a6a22f7f0ca2a778ef4aa4 (diff) | |
download | FreeBSD-src-51cb9c0c86fb97f3733907158934958a74de3579.zip FreeBSD-src-51cb9c0c86fb97f3733907158934958a74de3579.tar.gz |
Use snprintf instead of sprintf.
Diffstat (limited to 'usr.sbin/rpcbind')
-rw-r--r-- | usr.sbin/rpcbind/pmap_svc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/rpcbind/pmap_svc.c b/usr.sbin/rpcbind/pmap_svc.c index 26467d1..9adb558 100644 --- a/usr.sbin/rpcbind/pmap_svc.c +++ b/usr.sbin/rpcbind/pmap_svc.c @@ -215,8 +215,9 @@ pmapproc_change(struct svc_req *rqstp, SVCXPRT *xprt, unsigned long op) if (op == PMAPPROC_SET) { char buf[32]; - sprintf(buf, "0.0.0.0.%d.%d", (int)((reg.pm_port >> 8) & 0xff), - (int)(reg.pm_port & 0xff)); + snprintf(buf, sizeof buf, "0.0.0.0.%d.%d", + (int)((reg.pm_port >> 8) & 0xff), + (int)(reg.pm_port & 0xff)); rpcbreg.r_addr = buf; if (reg.pm_prot == IPPROTO_UDP) { rpcbreg.r_netid = udptrans; @@ -310,8 +311,8 @@ pmapproc_getport(struct svc_req *rqstp, SVCXPRT *xprt) &h4, &p1, &p2) == 6) { p1 = (fnd->pml_map.pm_port >> 8) & 0xff; p2 = (fnd->pml_map.pm_port) & 0xff; - sprintf(serveuaddr, "%d.%d.%d.%d.%d.%d", - h1, h2, h3, h4, p1, p2); + snprintf(serveuaddr, sizeof serveuaddr, + "%d.%d.%d.%d.%d.%d", h1, h2, h3, h4, p1, p2); if (is_bound(netid, serveuaddr)) { port = fnd->pml_map.pm_port; } else { /* this service is dead; delete it */ |