summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordownsj <downsj@openbsd.org>1997-02-05 14:22:18 +0000
committerdownsj <downsj@openbsd.org>1997-02-05 14:22:18 +0000
commit5984581e08b9a543b5c8adec00dd5d43e0ddbe10 (patch)
treef8829d844b58adfe2c1f9786fa8f88c0afde1d70
parentfor -a, survive existance of non-ethernet non-pointtopoint interfaces, Jean-Luc.Richier@imag.fr (diff)
downloadwireguard-openbsd-5984581e08b9a543b5c8adec00dd5d43e0ddbe10.tar.xz
wireguard-openbsd-5984581e08b9a543b5c8adec00dd5d43e0ddbe10.zip
If tty structure has not been initialized, don't dereference it.
-rw-r--r--sys/arch/hp300/dev/itevar.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/hp300/dev/itevar.h b/sys/arch/hp300/dev/itevar.h
index db168bf8631..7a3c265e33b 100644
--- a/sys/arch/hp300/dev/itevar.h
+++ b/sys/arch/hp300/dev/itevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: itevar.h,v 1.6 1997/02/03 04:47:39 downsj Exp $ */
+/* $OpenBSD: itevar.h,v 1.7 1997/02/05 14:22:18 downsj Exp $ */
/* $NetBSD: itevar.h,v 1.13 1997/01/30 09:18:57 thorpej Exp $ */
/*
@@ -189,7 +189,8 @@ struct ite_softc {
#define KBD_EXT_RIGHT_UP 0x93
#define TABSIZE 8
-#define TABEND(ip) ((ip)->tty->t_winsize.ws_col - TABSIZE)
+#define TABEND(ip) ((ip)->tty ? ((ip)->tty->t_winsize.ws_col - TABSIZE) \
+ : (80 - TABSIZE))
#ifdef _KERNEL
extern struct ite_data ite_cn; /* ite_data for console device */