]> code.delx.au - gnu-emacs/commit
Fix unlikely core dump in init_tty, and simplify terminfo case.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Aug 2013 18:10:30 +0000 (11:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Aug 2013 18:10:30 +0000 (11:10 -0700)
commit1fc8eb33f5534cd3828d7cd15e95771a514dc589
tree93b9ac5d7ec1eda4ff3b59868e3fe9f0bae22a7f
parentf5adc984fbdc82def6edc297e88c3ee993c674ae
Fix unlikely core dump in init_tty, and simplify terminfo case.

* term.c (init_tty) [TERMINFO]: Fix check for buffer overrun.
The old version incorrectly dumped core if malloc returned a
buffer containing only non-NUL bytes.
(init_tty): Do not allocate or free termcap buffers; the
struct does that for us now.
* termchar.h (TERMCAP_BUFFER_SIZE) [!TERMINFO]: New constant.
(struct tty_display_info): Define members termcap_term_buffer and
termcap_strings_buffer only if !TERMINFO, since terminfo doesn't
use them.  Allocate them directly in struct rather than indirectly
via a pointer, to simplify init_tty.
src/ChangeLog
src/term.c
src/termchar.h