diff options
| author | Kris Kennaway <kris@FreeBSD.org> | 2001-04-24 10:26:00 +0000 |
|---|---|---|
| committer | Kris Kennaway <kris@FreeBSD.org> | 2001-04-24 10:26:00 +0000 |
| commit | 1fef4cc97d3216aba532ee2078c09c63c31f3c62 (patch) | |
| tree | 9fcac9e8a368f42f1ff6774783885823328a496c | |
| parent | f39513d3be7ab57982d2c1fcc8a7741625315dde (diff) | |
Notes
| -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 9ac5502d81cf3..28334e66af970 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 cb71ae4380fb8..e1dfbc73de5af 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) |
