diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-30 08:32:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-30 08:32:45 +0000 |
commit | f31b603a20ae64835f3aae0c4b23badb73ca7b39 (patch) | |
tree | 71427abc51e78a143e3b32a3ea7ee2e877b80100 /sbin | |
parent | b2e36da3ea98bdb6b66a6601dde50aad48d7e5d4 (diff) |
snprintf
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fsck_msdos/dir.c | 6 | ||||
-rw-r--r-- | sbin/newlfs/newfs.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sbin/fsck_msdos/dir.c b/sbin/fsck_msdos/dir.c index 662b2f6ea48..b0555975efb 100644 --- a/sbin/fsck_msdos/dir.c +++ b/sbin/fsck_msdos/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.16 2003/03/13 09:09:25 deraadt Exp $ */ +/* $OpenBSD: dir.c,v 1.17 2003/03/30 08:31:53 deraadt Exp $ */ /* $NetBSD: dir.c,v 1.11 1997/10/17 11:19:35 ws Exp $ */ /* @@ -37,7 +37,7 @@ #ifndef lint -static char rcsid[] = "$OpenBSD: dir.c,v 1.16 2003/03/13 09:09:25 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dir.c,v 1.17 2003/03/30 08:31:53 deraadt Exp $"; #endif /* not lint */ #include <stdio.h> @@ -995,7 +995,7 @@ reconnect(dosfs, boot, fat, head) boot->NumFiles++; /* Ensure uniqueness of entry here! XXX */ (void)memset(&d, 0, sizeof d); - sprintf(d.name, "%u", head); + snprintf(d.name, sizeof d.name, "%u", head); d.flags = 0; d.head = head; d.size = fat[head].length * boot->ClusterSize; diff --git a/sbin/newlfs/newfs.c b/sbin/newlfs/newfs.c index eb4c29f0a71..0588fba8973 100644 --- a/sbin/newlfs/newfs.c +++ b/sbin/newlfs/newfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs.c,v 1.11 2002/05/22 08:21:02 deraadt Exp $ */ +/* $OpenBSD: newfs.c,v 1.12 2003/03/30 08:32:44 deraadt Exp $ */ /* $NetBSD: newfs.c,v 1.5 1996/05/16 07:17:50 thorpej Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95"; #else -static char rcsid[] = "$OpenBSD: newfs.c,v 1.11 2002/05/22 08:21:02 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: newfs.c,v 1.12 2003/03/30 08:32:44 deraadt Exp $"; #endif #endif /* not lint */ @@ -285,9 +285,10 @@ main(argc, argv) */ special = argv[0]; if (strchr(special, '/') == NULL) { - (void)sprintf(device, "%sr%s", _PATH_DEV, special); + (void)snprintf(device, sizeof device, "%sr%s", _PATH_DEV, special); if (stat(device, &st) == -1) - (void)sprintf(device, "%s%s", _PATH_DEV, special); + (void)snprintf(device, sizeof device, "%s%s", + _PATH_DEV, special); special = device; } if (!Nflag) { |