diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-11 15:18:54 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-11 15:18:54 +0000 |
commit | 17fdbbbbd36dd0f57381719477a4df3a9771df26 (patch) | |
tree | f5156d1d8e47c08bc274d75009b0aa67541e2fa1 /libexec/telnetd/utility.c | |
parent | bbbf292a68225de030d9d9ced38e0bce00decab0 (diff) |
strncpy vs strlcpy, some strlen missuse.
some other related minor cleanups, and spaces.
millert@ ok
Diffstat (limited to 'libexec/telnetd/utility.c')
-rw-r--r-- | libexec/telnetd/utility.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c index 69e16fb4ac9..6f3cc3e1983 100644 --- a/libexec/telnetd/utility.c +++ b/libexec/telnetd/utility.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utility.c,v 1.15 1998/07/10 08:06:24 deraadt Exp $ */ +/* $OpenBSD: utility.c,v 1.16 2001/06/11 15:18:53 mickey Exp $ */ /* $NetBSD: utility.c,v 1.9 1996/02/28 20:38:29 thorpej Exp $ */ /* @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95"; static char rcsid[] = "$NetBSD: utility.c,v 1.9 1996/02/28 20:38:29 thorpej Exp $"; #else -static char rcsid[] = "$OpenBSD: utility.c,v 1.15 1998/07/10 08:06:24 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: utility.c,v 1.16 2001/06/11 15:18:53 mickey Exp $"; #endif #endif /* not lint */ @@ -396,7 +396,6 @@ edithost(pat, host) register char *host; { register char *res = editedhost; - char *strncpy(); if (!pat) pat = ""; @@ -424,11 +423,9 @@ edithost(pat, host) pat++; } if (*host) - (void) strncpy(res, host, - sizeof editedhost - (res - editedhost) -1); + strlcpy(res, host, sizeof editedhost - (res - editedhost)); else *res = '\0'; - editedhost[sizeof editedhost - 1] = '\0'; } static char *putlocation; |