summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2003-09-08 11:56:09 +0000
committerKenichi Handa <handa@m17n.org>2003-09-08 11:56:09 +0000
commit463f5630a5e7cbe7f042bc1175d1fa1c4e98860f (patch)
tree3287d0c628fea2249abf4635b3a4f45bedd6f8c4 /src/term.c
parent4256310de631bd57c78b88b5131caa073315b3d7 (diff)
downloademacs-463f5630a5e7cbe7f042bc1175d1fa1c4e98860f.tar.gz
New directory
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/term.c b/src/term.c
index 1f4ceaec627..829f2d88e6b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2159,8 +2159,7 @@ term_init (terminal_type)
{
char *area;
char **address = &area;
- char *buffer = NULL;
- int buffer_size = 4096;
+ char buffer[2044];
register char *p;
int status;
struct frame *sf = XFRAME (selected_frame);
@@ -2172,6 +2171,9 @@ term_init (terminal_type)
area = (char *) xmalloc (2044);
+ if (area == 0)
+ abort ();
+
FrameRows = FRAME_LINES (sf);
FrameCols = FRAME_COLS (sf);
specified_window = FRAME_LINES (sf);
@@ -2200,7 +2202,6 @@ term_init (terminal_type)
Wcm_clear ();
- buffer = (char *) xmalloc (buffer_size);
status = tgetent (buffer, terminal_type);
if (status < 0)
{
@@ -2228,13 +2229,13 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
terminal_type);
#endif
}
-
-#ifndef TERMINFO
- if (strlen (buffer) >= buffer_size)
+#ifdef TERMINFO
+ area = (char *) xmalloc (2044);
+#else
+ area = (char *) xmalloc (strlen (buffer));
+#endif /* not TERMINFO */
+ if (area == 0)
abort ();
- buffer_size = strlen (buffer);
-#endif
- area = (char *) xmalloc (buffer_size);
TS_ins_line = tgetstr ("al", address);
TS_ins_multi_lines = tgetstr ("AL", address);
@@ -2559,8 +2560,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
#endif /* WINDOWSNT */
-
- xfree (buffer);
}
/* VARARGS 1 */
@@ -2596,5 +2595,3 @@ The function should accept no arguments. */);
defsubr (&Stty_display_color_cells);
}
-/* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193
- (do not change this comment) */