diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-02-07 02:40:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-02-07 02:40:39 +0000 |
commit | 40eaa7a6f4fec628aa311a20224267e2babd089b (patch) | |
tree | 696950f11014f306f98887bd407c44edd544e53d /usr.sbin/ypbind | |
parent | f562e19e566ffbdbc4f1801a463c85aee85a6569 (diff) |
snprintf
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index ede6bb3663a..25483180560 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypbind.c,v 1.30 1998/02/07 02:34:19 downsj Exp $ */ +/* $OpenBSD: ypbind.c,v 1.31 1998/02/07 02:40:38 deraadt Exp $ */ /* * Copyright (c) 1996 Theo de Raadt <deraadt@theos.com> @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypbind.c,v 1.30 1998/02/07 02:34:19 downsj Exp $"; +static char rcsid[] = "$OpenBSD: ypbind.c,v 1.31 1998/02/07 02:40:38 deraadt Exp $"; #endif #include <sys/param.h> @@ -183,11 +183,11 @@ ypbindproc_domain_2x(transp, argp, clnt) ypdb->dom_vers = YPVERS; ypdb->dom_alive = 0; ypdb->dom_lockfd = -1; - sprintf(path, "%s/%s.%d", BINDINGDIR, + snprintf(path, sizeof path, "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, (int)ypdb->dom_vers); unlink(path); - sprintf(ypdb->dom_servlist, "%s/%s", - SERVERSDIR, ypdb->dom_domain); + snprintf(ypdb->dom_servlist, sizeof, ypdb->dom_servlist, + "%s/%s", SERVERSDIR, ypdb->dom_domain); ypdb->dom_servlistfp = fopen(ypdb->dom_servlist, "r"); ypdb->dom_xid = unique_xid(ypdb); ypdb->dom_pnext = ypbindlist; @@ -518,13 +518,13 @@ main(argc, argv) strncpy(ypbindlist->dom_domain, domain, sizeof ypbindlist->dom_domain-1); ypbindlist->dom_domain[sizeof (ypbindlist->dom_domain)-1] = '\0'; ypbindlist->dom_vers = YPVERS; - sprintf(ypbindlist->dom_servlist, "%s/%s", - SERVERSDIR, ypbindlist->dom_domain); + snprintf(ypbindlist->dom_servlist, sizeof ypbindlist->dom_servlist, + "%s/%s", SERVERSDIR, ypbindlist->dom_domain); ypbindlist->dom_servlistfp = fopen(ypbindlist->dom_servlist, "r"); ypbindlist->dom_alive = 0; ypbindlist->dom_lockfd = -1; ypbindlist->dom_xid = unique_xid(ypbindlist); - sprintf(path, "%s/%s.%d", BINDINGDIR, + snprintf(path, sizeof path, "%s/%s.%d", BINDINGDIR, ypbindlist->dom_domain, (int)ypbindlist->dom_vers); (void)unlink(path); @@ -717,7 +717,7 @@ pings(ypdb) if (ypdb->dom_lockfd != -1) { close(ypdb->dom_lockfd); ypdb->dom_lockfd = -1; - sprintf(path, "%s/%s.%d", BINDINGDIR, + snprintf(path, sizeof path, "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, (int)ypdb->dom_vers); unlink(path); } @@ -1064,7 +1064,7 @@ int force; if (ypdb->dom_lockfd != -1) close(ypdb->dom_lockfd); - sprintf(path, "%s/%s.%d", BINDINGDIR, + snprintf(path, sizeof path, "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, (int)ypdb->dom_vers); #ifdef O_SHLOCK if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) { |