• Paul Eggert's avatar
    Fix unlikely core dump in init_tty, and simplify terminfo case. · 1fc8eb33
    Paul Eggert authored
    * 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.
    1fc8eb33
term.c 99.5 KB