diff options
author | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-07-02 22:38:55 +0000 |
---|---|---|
committer | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-07-02 22:38:55 +0000 |
commit | 86b5ca3b049e9ee22fa9e43a4728595e04d15a54 (patch) | |
tree | a2a830931f8160e1b56effe2d44d3f54e895a273 /sbin | |
parent | d0cc8a727e3b2d10f23741a98e7f92ea50cd24f4 (diff) |
convert strncat -> strlcat
millert@ ok
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mount_ados/mount_ados.c | 8 | ||||
-rw-r--r-- | sbin/mount_msdos/mount_msdos.c | 10 | ||||
-rw-r--r-- | sbin/mount_ntfs/mount_ntfs.c | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sbin/mount_ados/mount_ados.c b/sbin/mount_ados/mount_ados.c index 9bee15d5bb7..be8da3859e8 100644 --- a/sbin/mount_ados/mount_ados.c +++ b/sbin/mount_ados/mount_ados.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ados.c,v 1.10 2003/06/11 06:22:13 deraadt Exp $ */ +/* $OpenBSD: mount_ados.c,v 1.11 2003/07/02 22:38:53 avsm Exp $ */ /* $NetBSD: mount_ados.c,v 1.5 1996/04/13 01:30:59 jtc Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.10 2003/06/11 06:22:13 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.11 2003/07/02 22:38:53 avsm Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -105,8 +105,8 @@ main(int argc, char *argv[]) warnx("\"%s\" is a relative path.", dir); if (getcwd(ndir, sizeof(ndir)) == NULL) err(1, "getcwd"); - strncat(ndir, "/", sizeof(ndir) - strlen(ndir)); - strncat(ndir, dir, sizeof(ndir) - strlen(ndir)); + strlcat(ndir, "/", sizeof(ndir)); + strlcat(ndir, dir, sizeof(ndir)); dir = ndir; warnx("using \"%s\" instead.", dir); } diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index aa1b31f7c87..13969e8e1c6 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_msdos.c,v 1.16 2003/06/11 06:22:14 deraadt Exp $ */ +/* $OpenBSD: mount_msdos.c,v 1.17 2003/07/02 22:38:53 avsm Exp $ */ /* $NetBSD: mount_msdos.c,v 1.16 1996/10/24 00:12:50 cgd Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.16 2003/06/11 06:22:14 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.17 2003/07/02 22:38:53 avsm Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -68,7 +68,7 @@ main(int argc, char **argv) struct msdosfs_args args; struct stat sb; int c, mntflags, set_gid, set_uid, set_mask; - char *dev, *dir, ndir[MAXPATHLEN+1]; + char *dev, *dir, ndir[MAXPATHLEN]; char *errcause; mntflags = set_gid = set_uid = set_mask = 0; @@ -122,8 +122,8 @@ main(int argc, char **argv) warnx("\"%s\" is a relative path.", dir); if (getcwd(ndir, sizeof(ndir)) == NULL) err(1, "getcwd"); - strncat(ndir, "/", sizeof(ndir) - strlen(ndir)); - strncat(ndir, dir, sizeof(ndir) - strlen(ndir)); + strlcat(ndir, "/", sizeof(ndir)); + strlcat(ndir, dir, sizeof(ndir)); dir = ndir; warnx("using \"%s\" instead.", dir); } diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index b0b799e8335..fa602047ede 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ntfs.c,v 1.6 2003/06/11 06:22:14 deraadt Exp $ */ +/* $OpenBSD: mount_ntfs.c,v 1.7 2003/07/02 22:38:54 avsm Exp $ */ /* $NetBSD: mount_ntfs.c,v 1.9 2003/05/03 15:37:08 christos Exp $ */ /* @@ -117,8 +117,8 @@ main(int argc, char *argv[]) warnx("\"%s\" is a relative path", dir); if (getcwd(ndir, sizeof(ndir)) == NULL) err(EX_OSERR, "getcwd"); - strncat(ndir, "/", sizeof(ndir) - strlen(ndir) - 1); - strncat(ndir, dir, sizeof(ndir) - strlen(ndir) - 1); + strlcat(ndir, "/", sizeof(ndir)); + strlcat(ndir, dir, sizeof(ndir)); dir = ndir; warnx("using \"%s\" instead", dir); } |