diff options
author | kris <kris@FreeBSD.org> | 2001-04-24 10:26:00 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-04-24 10:26:00 +0000 |
commit | 3edf709f74475d34ec86309e00d1b7aefdda2618 (patch) | |
tree | 1e6f7ac7f14cfb84c86f3beed70b777049f1e48c /sbin/newfs | |
parent | d5df9464e24a4e140b885df04c676bea637d0070 (diff) | |
download | FreeBSD-src-3edf709f74475d34ec86309e00d1b7aefdda2618.zip FreeBSD-src-3edf709f74475d34ec86309e00d1b7aefdda2618.tar.gz |
sprintf() -> snprintf()
Partially submitted by: "Andrew R. Reiter" <arr@watson.org>
Obtained from: OpenBSD
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/mkfs.c | 2 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 9ac5502..28334e6 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -710,7 +710,7 @@ next: initcg(cylno, utime); if (mfs) continue; - j = sprintf(tmpbuf, " %ld%s", + j = snprintf(tmpbuf, sizeof(tmpbuf), " %ld%s", fsbtodb(&sblock, cgsblock(&sblock, cylno)), cylno < (sblock.fs_ncg-1) ? "," : "" ); if (i + j >= width) { diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index cb71ae4..e1dfbc7 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -427,7 +427,7 @@ main(argc, argv) /* * No path prefix; try /dev/%s. */ - (void)sprintf(device, "%s%s", _PATH_DEV, special); + (void)snprintf(device, sizeof(device), "%s%s", _PATH_DEV, special); special = device; } if (Nflag) { @@ -638,7 +638,7 @@ havelabel: if (mfs) { struct mfs_args args; - sprintf(buf, "mfs:%d", getpid()); + snprintf(buf, sizeof(buf), "mfs:%d", getpid()); args.fspec = buf; args.export.ex_root = -2; if (mntflags & MNT_RDONLY) |