summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 09:19:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 09:19:53 +0000
commita2f77e2c291ced0b85e36486c6ca1e2cfb53b64a (patch)
tree85f813cad0c29b4963fad90d0b56f26b307dc52a
parent46aecf92d88c8914c462878f485c11755d4f7041 (diff)
more snprintf
-rw-r--r--sbin/newfs/mkfs.c6
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 0e21f95c6de..b46172d8bc6 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.20 2001/11/05 07:39:17 mpech Exp $ */
+/* $OpenBSD: mkfs.c,v 1.21 2002/05/29 09:19:52 deraadt Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94";
#else
-static char rcsid[] = "$OpenBSD: mkfs.c,v 1.20 2001/11/05 07:39:17 mpech Exp $";
+static char rcsid[] = "$OpenBSD: mkfs.c,v 1.21 2002/05/29 09:19:52 deraadt Exp $";
#endif
#endif /* not lint */
@@ -662,7 +662,7 @@ next:
initcg(cylno, utime);
if (quiet)
continue;
- j = sprintf(tmpbuf, " %ld,",
+ j = snprintf(tmpbuf, sizeof tmpbuf, " %ld,",
fsbtodb(&sblock, cgsblock(&sblock, cylno)));
if (i+j >= width) {
printf("\n");
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index acfd782f55e..c82aec440dd 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -634,7 +634,7 @@ main(int argc, char *argv[])
(u_int)tm->tm_min));
mk4(bsx->volid, x);
mklabel(bsx->label, opt_L ? opt_L : "NO NAME");
- sprintf(buf, "FAT%u", fat);
+ snprintf(buf, sizeof buf, "FAT%u", fat);
setstr(bsx->type, buf, sizeof(bsx->type));
if (!opt_B) {
x1 += sizeof(struct bsx);