diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-11 05:29:56 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-11 05:29:56 +0000 |
commit | c2384b027be35ad0d56abd0a775e8706ba286ec7 (patch) | |
tree | a0c7dfc0dec5747c3a7ff09f912571d2a91e5b60 /usr.sbin/amd/mk-amd-map | |
parent | 1e2ae257826f6e35ff6124fe764057666daf08c3 (diff) |
use snprintf.
Diffstat (limited to 'usr.sbin/amd/mk-amd-map')
-rw-r--r-- | usr.sbin/amd/mk-amd-map/mk-amd-map.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/amd/mk-amd-map/mk-amd-map.c b/usr.sbin/amd/mk-amd-map/mk-amd-map.c index 0333f41ea7d..55ffbaa7d4f 100644 --- a/usr.sbin/amd/mk-amd-map/mk-amd-map.c +++ b/usr.sbin/amd/mk-amd-map/mk-amd-map.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)mk-amd-map.c 8.1 (Berkeley) 6/28/93 - * $Id: mk-amd-map.c,v 1.3 1997/04/04 18:41:42 deraadt Exp $ + * $Id: mk-amd-map.c,v 1.4 2002/06/11 05:29:55 itojun Exp $ */ /* @@ -52,7 +52,7 @@ char copyright[] = "\ #endif /* not lint */ #ifndef lint -static char rcsid[] = "$Id: mk-amd-map.c,v 1.3 1997/04/04 18:41:42 deraadt Exp $"; +static char rcsid[] = "$Id: mk-amd-map.c,v 1.4 2002/06/11 05:29:55 itojun Exp $"; static char sccsid[] = "@(#)mk-amd-map.c 8.1 (Berkeley) 6/28/93"; #endif /* not lint */ @@ -284,7 +284,7 @@ char *argv[]; exit(1); } mktemp(maptmp); - sprintf(maptpag, "%s%s", maptmp, DBM_SUFFIX); + snprintf(maptpag, sizeof(maptpag), "%s%s", maptmp, DBM_SUFFIX); if (remove_file(maptpag) < 0) { fprintf(stderr, "Can't remove existing temporary file"); perror(maptpag); @@ -298,8 +298,8 @@ char *argv[]; exit(1); } mktemp(maptmp); - sprintf(maptpag, "%s.pag", maptmp); - sprintf(maptdir, "%s.dir", maptmp); + snprintf(maptpag, sizeof(maptpag), "%s.pag", maptmp); + snprintf(maptdir, sizeof(maptdir), "%s.dir", maptmp); if (remove_file(maptpag) < 0 || remove_file(maptdir) < 0) { fprintf(stderr, "Can't remove existing temporary files; %s and", maptpag); perror(maptdir); @@ -334,7 +334,7 @@ char *argv[]; rc = 1; } else { #ifdef USING_DB - sprintf(mappag, "%s%s", map, DBM_SUFFIX); + snprintf(mappag, sizeof(mappag), "%s%s", map, DBM_SUFFIX); if (rename(maptpag, mappag) < 0) { fprintf(stderr, "Couldn't rename %s to ", maptpag); perror(mappag); @@ -343,8 +343,8 @@ char *argv[]; rc = 1; } #else - sprintf(mappag, "%s.pag", map); - sprintf(mapdir, "%s.dir", map); + snprintf(mappag, sizeof(mappag), "%s.pag", map); + snprintf(mapdir, sizeof(mapdir), "%s.dir", map); if (rename(maptpag, mappag) < 0) { fprintf(stderr, "Couldn't rename %s to ", maptpag); perror(mappag); |