aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tuiStack.c
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-09-13 19:37:47 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-09-13 19:37:47 +0000
commita42a37b7258f08c601ba1de2c6fdf8f8a1a0e2a9 (patch)
tree652945101af53a7b0e69bb69d9a18319f239c31d /gdb/tui/tuiStack.c
parent795e1e11283aa9af93e98cfa1d9b29b99294a810 (diff)
downloadgdb-a42a37b7258f08c601ba1de2c6fdf8f8a1a0e2a9.zip
gdb-a42a37b7258f08c601ba1de2c6fdf8f8a1a0e2a9.tar.gz
gdb-a42a37b7258f08c601ba1de2c6fdf8f8a1a0e2a9.tar.bz2
* tuiStack.c (tui_make_status_line): Make sure the local buffer
is large enough to hold the complete line.
Diffstat (limited to 'gdb/tui/tuiStack.c')
-rw-r--r--gdb/tui/tuiStack.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c
index 10bd259..1d3856d 100644
--- a/gdb/tui/tuiStack.c
+++ b/gdb/tui/tuiStack.c
@@ -79,8 +79,9 @@ static char*
tui_make_status_line (TuiLocatorElement* loc)
{
char* string;
- char line_buf[50], buf[50], *pname;
- int status_size = termWidth ();
+ char line_buf[50], *pname;
+ char* buf;
+ int status_size;
int i, proc_width;
const char* pid_name;
const char* pc_buf;
@@ -102,8 +103,10 @@ tui_make_status_line (TuiLocatorElement* loc)
pid_width = strlen (pid_name);
if (pid_width > MAX_PID_WIDTH)
pid_width = MAX_PID_WIDTH;
-
+
+ status_size = termWidth ();
string = (char *) xmalloc (status_size + 1);
+ buf = (char*) alloca (status_size + 1);
/* Translate line number and obtain its size. */
if (loc->lineNo > 0)