diff options
author | 1996-08-31 02:40:30 +0000 | |
---|---|---|
committer | 1996-08-31 02:40:30 +0000 | |
commit | e95a6c66636b16fac8edf485bf185e59d4db79ef (patch) | |
tree | 1c046abca55b2c2ffd8639cdafcba5157c3efe6f | |
parent | Avoid crashing when buggy applications check for capabilities without (diff) | |
download | wireguard-openbsd-e95a6c66636b16fac8edf485bf185e59d4db79ef.tar.xz wireguard-openbsd-e95a6c66636b16fac8edf485bf185e59d4db79ef.zip |
Fix thinko in last change
-rw-r--r-- | lib/libtermlib/del_curterm.c | 10 | ||||
-rw-r--r-- | lib/libtermlib/globals.c | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/libtermlib/del_curterm.c b/lib/libtermlib/del_curterm.c index b2598918223..bc55d8897fe 100644 --- a/lib/libtermlib/del_curterm.c +++ b/lib/libtermlib/del_curterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: del_curterm.c,v 1.1.1.1 1996/05/31 05:40:02 tholo Exp $ */ +/* $OpenBSD: del_curterm.c,v 1.2 1996/08/31 02:40:30 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,12 +31,14 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: del_curterm.c,v 1.1.1.1 1996/05/31 05:40:02 tholo Exp $"; +static char rcsid[] = "$OpenBSD: del_curterm.c,v 1.2 1996/08/31 02:40:30 tholo Exp $"; #endif #include <stdlib.h> #include "term.h" +extern TERMINAL _ti_empty; + /* * Free storage associated with the terminal description * passed in. Note that it is legal to free cur_term in @@ -51,6 +53,8 @@ del_curterm(term) { int i; + if (term == &_ti_empty) + return OK; for (i = 0; i < _tStrCnt; i++) if (term->strs[i] != NULL) free(term->strs[i]); @@ -61,6 +65,6 @@ del_curterm(term) * one, set cur_term to NULL */ if (term == cur_term) - cur_term = NULL; + cur_term = &_ti_empty; return OK; } diff --git a/lib/libtermlib/globals.c b/lib/libtermlib/globals.c index 2de158e8bff..7e96e9ea552 100644 --- a/lib/libtermlib/globals.c +++ b/lib/libtermlib/globals.c @@ -1,4 +1,4 @@ -/* $OpenBSD: globals.c,v 1.1 1996/08/31 02:36:59 tholo Exp $ */ +/* $OpenBSD: globals.c,v 1.2 1996/08/31 02:40:30 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,13 +31,13 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: globals.c,v 1.1 1996/08/31 02:36:59 tholo Exp $"; +static char rcsid[] = "$OpenBSD: globals.c,v 1.2 1996/08/31 02:40:30 tholo Exp $"; #endif #include "term.h" -static TERMINAL empty = { +TERMINAL _ti_empty = { -1, 9600, {}, {}, "dumb", {}, { 80, 0, 24 }, {} }; -TERMINAL *cur_term = ∅ +TERMINAL *cur_term = &_ti_empty; |