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/getty/subr.c | |
parent | bbbf292a68225de030d9d9ced38e0bce00decab0 (diff) |
strncpy vs strlcpy, some strlen missuse.
some other related minor cleanups, and spaces.
millert@ ok
Diffstat (limited to 'libexec/getty/subr.c')
-rw-r--r-- | libexec/getty/subr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index a8a562abe00..21efd017a17 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr.c,v 1.11 2001/01/28 19:34:28 niklas Exp $ */ +/* $OpenBSD: subr.c,v 1.12 2001/06/11 15:18:50 mickey Exp $ */ /* * Copyright (c) 1983, 1993 @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/ -static char rcsid[] = "$OpenBSD: subr.c,v 1.11 2001/01/28 19:34:28 niklas Exp $"; +static char rcsid[] = "$OpenBSD: subr.c,v 1.12 2001/06/11 15:18:50 mickey Exp $"; #endif /* not lint */ /* @@ -99,8 +99,8 @@ gettable(name, buf) for (np = gettynums; np->field; np++) printf("cgetnum: %s=%d\n", np->field, np->value); for (fp = gettyflags; fp->field; fp++) - printf("cgetflags: %s='%c' set='%c'\n", fp->field, - fp->value + '0', fp->set + '0'); + printf("cgetflags: %s='%c' set='%c'\n", fp->field, + fp->value + '0', fp->set + '0'); exit(1); #endif /* DEBUG */ } @@ -603,10 +603,9 @@ edithost(pat) pat++; } if (*host) - strncpy(res, host, sizeof editedhost - (res - editedhost) - 1); + strlcpy(res, host, sizeof editedhost - (res - editedhost)); else *res = '\0'; - editedhost[sizeof editedhost - 1] = '\0'; } void |