diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-27 10:23:01 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-27 10:23:01 +0000 |
commit | 0f7e2904e911f96612afeafde7819fa1e4dc54cf (patch) | |
tree | 6f998798a07036e99b85f22f624d4d3921532fdc /libexec/comsat | |
parent | b599ca4ee02d7ee92a38332bd0bce529fdbf6bf8 (diff) |
strncpy correctly
Diffstat (limited to 'libexec/comsat')
-rw-r--r-- | libexec/comsat/comsat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index b0eaec4fece..0b4e41d3273 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -39,7 +39,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)comsat.c 8.1 (Berkeley) 6/4/93";*/ -static char rcsid[] = "$Id: comsat.c,v 1.1 1995/10/18 08:43:15 deraadt Exp $"; +static char rcsid[] = "$Id: comsat.c,v 1.2 1996/08/27 10:22:04 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -221,7 +221,7 @@ notify(utp, offset) (void)tcgetattr(fileno(tp), &ttybuf); cr = (ttybuf.c_oflag & ONLCR) && (ttybuf.c_oflag & OPOST) ? "\n" : "\n\r"; - (void)strncpy(name, utp->ut_name, sizeof(utp->ut_name)); + (void)strncpy(name, utp->ut_name, sizeof(name) - 1); name[sizeof(name) - 1] = '\0'; (void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived:%s----%s", cr, name, (int)sizeof(hostname), hostname, cr, cr); |