diff options
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) |