summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass1b.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-22 20:24:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-22 20:24:33 +0000
commit7a84eeaefb730ed882dadd3082e3d4f9c1edf250 (patch)
treefa7c5e94f9a0541e5026db02cf24056ae8b85592 /sbin/fsck_ffs/pass1b.c
parent82b54f0f3f93de8d6fd760bb2514479ea752b604 (diff)
earlier asprintf diff caused malloc in signal handler. clarify the
code a bit more so that this mistake will not be done again
Diffstat (limited to 'sbin/fsck_ffs/pass1b.c')
-rw-r--r--sbin/fsck_ffs/pass1b.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c
index b54a1fa469c..4224ae2fa2e 100644
--- a/sbin/fsck_ffs/pass1b.c
+++ b/sbin/fsck_ffs/pass1b.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1b.c,v 1.12 2006/03/12 02:28:28 deraadt Exp $ */
+/* $OpenBSD: pass1b.c,v 1.13 2006/03/22 20:24:32 deraadt Exp $ */
/* $NetBSD: pass1b.c,v 1.10 1996/09/23 16:18:37 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1b.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass1b.c,v 1.12 2006/03/12 02:28:28 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: pass1b.c,v 1.13 2006/03/22 20:24:32 deraadt Exp $";
#endif
#endif /* not lint */
@@ -54,9 +54,9 @@ static struct dups *duphead;
static ino_t info_inumber;
static int
-pass1b_info(char *buf)
+pass1b_info(char *buf, size_t buflen)
{
- return (asprintf(&buf, "phase 1b, inode %d/%d",
+ return (snprintf(buf, buflen, "phase 1b, inode %d/%d",
info_inumber, sblock.fs_ipg * sblock.fs_ncg) > 0);
}