avoid array bounds violation on netbsd/mips when dealing with termio

structures.  (did linux/mips ever support termio?).

the effect of this is that termio linux apps won't have VEOF support.
i can't tell what it should be since that code isn't in linux going
back quite some years.
This commit is contained in:
mrg 2011-07-04 12:39:36 +00:00
parent b0c66baaac
commit 97796e3e22
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_termios.h,v 1.19 2009/03/15 15:55:51 cegger Exp $ */
/* $NetBSD: linux_termios.h,v 1.20 2011/07/04 12:39:36 mrg Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -263,7 +263,9 @@ linux_termio_to_bsd_termios(struct linux_termio *lt, struct termios *bts)
bts->c_cc[VQUIT] = lt->c_cc[LINUX_OLD_VQUIT];
bts->c_cc[VERASE] = lt->c_cc[LINUX_OLD_VERASE];
bts->c_cc[VKILL] = lt->c_cc[LINUX_OLD_VKILL];
#if LINUX_VEOF < LINUX_NCC
bts->c_cc[VEOF] = lt->c_cc[LINUX_OLD_VEOF];
#endif
bts->c_cc[VTIME] = lt->c_cc[LINUX_OLD_VTIME];
bts->c_cc[VMIN] = lt->c_cc[LINUX_OLD_VMIN];
}
@ -347,7 +349,9 @@ bsd_termios_to_linux_termio(struct termios *bts, struct linux_termio *lt)
lt->c_cc[LINUX_VQUIT] = bts->c_cc[VQUIT];
lt->c_cc[LINUX_VERASE] = bts->c_cc[VERASE];
lt->c_cc[LINUX_VKILL] = bts->c_cc[VKILL];
#if LINUX_VEOF < LINUX_NCC
lt->c_cc[LINUX_VEOF] = bts->c_cc[VEOF];
#endif
lt->c_cc[LINUX_VTIME] = bts->c_cc[VTIME];
lt->c_cc[LINUX_VMIN] = bts->c_cc[VMIN];
lt->c_cc[LINUX_VSWTC] = 0;