diff src/term.c @ 88123:375f2633d815

New directory
author Kenichi Handa <handa@m17n.org>
date Mon, 08 Sep 2003 11:56:09 +0000
parents 695cf19ef79e
children 2f877ed80fa6
line wrap: on
line diff
--- a/src/term.c	Thu Sep 04 04:00:49 2003 +0000
+++ b/src/term.c	Mon Sep 08 11:56:09 2003 +0000
@@ -2159,8 +2159,7 @@
 {
   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 @@
 
   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 @@
 
   Wcm_clear ();
 
-  buffer = (char *) xmalloc (buffer_size);
   status = tgetent (buffer, terminal_type);
   if (status < 0)
     {
@@ -2228,13 +2229,13 @@
 	     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 @@
   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 @@
   defsubr (&Stty_display_color_cells);
 }
 
-/* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193
-   (do not change this comment) */