From d46fa770f652a1357cf3d9b52414f221cec739f7 Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Tue, 18 Jun 1996 20:40:23 +0000 Subject: Fix off by one error when setting up ttytype[] --- lib/libtermlib/getterm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libtermlib') diff --git a/lib/libtermlib/getterm.c b/lib/libtermlib/getterm.c index 87d8cdeedc8..3b50c6b354d 100644 --- a/lib/libtermlib/getterm.c +++ b/lib/libtermlib/getterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getterm.c,v 1.2 1996/06/18 20:29:40 tholo Exp $ */ +/* $OpenBSD: getterm.c,v 1.3 1996/06/18 20:40:22 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: getterm.c,v 1.2 1996/06/18 20:29:40 tholo Exp $"; +static char rcsid[] = "$OpenBSD: getterm.c,v 1.3 1996/06/18 20:40:22 tholo Exp $"; #endif #include @@ -147,7 +147,7 @@ _ti_getterm(name) ttytype[MAXSIZE - 1] = '\0'; } else { - strncpy(ttytype, dummy + (dummy[2] == '|' ? 2 : 0), + strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0), MIN(MAXSIZE - 1, s - dummy)); ttytype[MAXSIZE - 1] = '\0'; *home = '\0'; -- cgit v1.2.3