diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-08-27 03:32:34 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-08-27 03:32:34 +0000 |
commit | 435a38d9dfc2ff6b7444727e9da4e521828bfbec (patch) | |
tree | 0658912be028fe05a25d1767a4f3e66adcbad8c1 /lib/libtermlib/fillcap.c | |
parent | 69993b43f2f7c55a601714bcbc35bc1409fa3c89 (diff) |
Ensure strings are NUL terminated after strncpy
Diffstat (limited to 'lib/libtermlib/fillcap.c')
-rw-r--r-- | lib/libtermlib/fillcap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libtermlib/fillcap.c b/lib/libtermlib/fillcap.c index cc103e81cd1..f868d4e5b40 100644 --- a/lib/libtermlib/fillcap.c +++ b/lib/libtermlib/fillcap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fillcap.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ +/* $OpenBSD: fillcap.c,v 1.2 1996/08/27 03:32:32 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fillcap.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; +static char rcsid[] = "$OpenBSD: fillcap.c,v 1.2 1996/08/27 03:32:32 tholo Exp $"; #endif #include <stdio.h> @@ -92,7 +92,7 @@ _ti_fillcap(term) sprintf(buf, "%s\n$<%d>", carriage_return, new_line_delay); else { strncpy(buf, carriage_return, sizeof(buf) >> 1); - buf[sizeof(buf) - 2] = '\0'; + buf[sizeof(buf) >> 1] = '\0'; strncat(buf, "\n", sizeof(buf) - 1); } buf[sizeof(buf) - 1] = '\0'; |