diff options
-rw-r--r-- | lib/libutil/readlabel.c | 6 | ||||
-rw-r--r-- | libexec/telnetd/sys_term.c | 4 | ||||
-rw-r--r-- | sbin/newfs_msdos/newfs_msdos.c | 2 | ||||
-rw-r--r-- | usr.bin/write/write.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/physical.c | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/lib/libutil/readlabel.c b/lib/libutil/readlabel.c index b4634dab846..b94c677c9c1 100644 --- a/lib/libutil/readlabel.c +++ b/lib/libutil/readlabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readlabel.c,v 1.5 2001/08/16 18:34:40 millert Exp $ */ +/* $OpenBSD: readlabel.c,v 1.6 2002/02/21 07:32:55 fgsch Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -74,9 +74,9 @@ char *readlabelfs(device, verbose) rpath[strlen(rpath) - 1] = 'a' + getrawpartition(); break; case S_IFBLK: - if (strlen(device) > strlen(_PATH_DEV)) { + if (strlen(device) > sizeo(_PATH_DEV) - 1) { snprintf(rpath, sizeof(rpath), "%sr%s", _PATH_DEV, - &device[strlen(_PATH_DEV)]); + &device[sizeof(_PATH_DEV) - 1]); /* Change partition name. */ part = rpath[strlen(rpath) - 1]; diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index d4675c67349..9a63b1f77da 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -1074,8 +1074,8 @@ clean_ttyname (char *tty) { char *res = tty; - if (strncmp (res, _PATH_DEV, strlen(_PATH_DEV)) == 0) - res += strlen(_PATH_DEV); + if (strncmp (res, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + res += sizeof(_PATH_DEV) - 1; if (strncmp (res, "pty/", 4) == 0) res += 4; if (strncmp (res, "ptym/", 5) == 0) diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index e2c8f4066bd..acfd782f55e 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -697,7 +697,7 @@ check_mounted(const char *fname, mode_t mode) if (!(n = getmntinfo(&mp, MNT_NOWAIT))) err(1, "getmntinfo"); - len = strlen(_PATH_DEV); + len = sizeof(_PATH_DEV) - 1; s1 = fname; if (!strncmp(s1, _PATH_DEV, len)) s1 += len; diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index 7597973b31a..da5ebad1ee2 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: write.c,v 1.15 2002/02/16 21:27:59 millert Exp $ */ +/* $OpenBSD: write.c,v 1.16 2002/02/21 07:32:55 fgsch Exp $ */ /* $NetBSD: write.c,v 1.5 1995/08/31 21:48:32 jtc Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)write.c 8.2 (Berkeley) 4/27/95"; #endif -static char *rcsid = "$OpenBSD: write.c,v 1.15 2002/02/16 21:27:59 millert Exp $"; +static char *rcsid = "$OpenBSD: write.c,v 1.16 2002/02/21 07:32:55 fgsch Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -111,8 +111,8 @@ main(argc, argv) do_write(tty, mytty, myuid); break; case 3: - if (!strncmp(argv[2], _PATH_DEV, strlen(_PATH_DEV))) - argv[2] += strlen(_PATH_DEV); + if (!strncmp(argv[2], _PATH_DEV, sizeof(_PATH_DEV) - 1)) + argv[2] += sizeof(_PATH_DEV) - 1; if (utmp_chk(argv[1], argv[2])) errx(1, "%s is not logged in on %s", argv[1], argv[2]); diff --git a/usr.sbin/ppp/ppp/physical.c b/usr.sbin/ppp/ppp/physical.c index eca7887ea33..1b7794c5766 100644 --- a/usr.sbin/ppp/ppp/physical.c +++ b/usr.sbin/ppp/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: physical.c,v 1.31 2001/08/19 23:22:18 brian Exp $ + * $OpenBSD: physical.c,v 1.32 2002/02/21 07:32:55 fgsch Exp $ * */ @@ -593,7 +593,7 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, p->desc.Write = physical_DescriptorWrite; p->type = PHYS_DIRECT; p->dl = dl; - len = strlen(_PATH_DEV); + len = sizeof(_PATH_DEV) - 1; p->out = NULL; p->connect_count = 1; @@ -953,7 +953,7 @@ physical_DeleteQueue(struct physical *p) void physical_SetDevice(struct physical *p, const char *name) { - int len = strlen(_PATH_DEV); + int len = sizeof(_PATH_DEV) - 1; if (name != p->name.full) { strncpy(p->name.full, name, sizeof p->name.full - 1); |