summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass1.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-16 17:37:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-16 17:37:26 +0000
commit306d2c85cf362a9041b81c448dd0d093d1b05585 (patch)
tree8ea1d711f1f91e344aeb42783ea780f3acf75b69 /sbin/fsck_ffs/pass1.c
parent9ece674622a863eb59f1b51f503bf9e5cea2b24f (diff)
while snprintf and strlcpy and strlcat have this nice >buflen API (and the
-1 mess as well), it is probably not wise to make other functions do the same thing. make them return strlen(). ok uwe marco
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r--sbin/fsck_ffs/pass1.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 0f0fcfd7e56..cb59f878992 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1.c,v 1.15 2003/10/11 01:43:45 tedu Exp $ */
+/* $OpenBSD: pass1.c,v 1.16 2005/04/16 17:37:25 deraadt Exp $ */
/* $NetBSD: pass1.c,v 1.16 1996/09/27 22:45:15 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass1.c,v 1.15 2003/10/11 01:43:45 tedu Exp $";
+static const char rcsid[] = "$OpenBSD: pass1.c,v 1.16 2005/04/16 17:37:25 deraadt Exp $";
#endif
#endif /* not lint */
@@ -61,8 +61,10 @@ static ino_t info_inumber;
static int
pass1_info(char *buf, int buflen)
{
- return snprintf(buf, buflen, "phase 1, inode %d/%d",
- info_inumber, sblock.fs_ipg * sblock.fs_ncg);
+ if (snprintf(buf, buflen, "phase 1, inode %d/%d",
+ info_inumber, sblock.fs_ipg * sblock.fs_ncg) > 0)
+ return (strlen(buf));
+ return (0);
}
void