diff options
author | 1996-06-18 20:40:22 +0000 | |
---|---|---|
committer | 1996-06-18 20:40:22 +0000 | |
commit | 6077f343b512914ed952ca7de3c6755479c261a4 (patch) | |
tree | 531db950b1f017a167d5432ece2c64faa40cfaea | |
parent | Our terminfo emulation library now supports ttytype[], no need to special- (diff) | |
download | wireguard-openbsd-6077f343b512914ed952ca7de3c6755479c261a4.tar.xz wireguard-openbsd-6077f343b512914ed952ca7de3c6755479c261a4.zip |
Fix off by one error when setting up ttytype[]
-rw-r--r-- | lib/libtermlib/getterm.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 <tholo@sigmasoft.com> @@ -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 <stdlib.h> @@ -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'; |