aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-file.c7
-rw-r--r--gdb/tui/tui-io.c2
-rw-r--r--gdb/tui/tui-source.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 4b4b92c..1aa0a61 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -107,7 +107,7 @@ tui_sfileopen (int n)
tmpstream->ts_filestream = NULL;
if (n > 0)
{
- tmpstream->ts_strbuf = xmalloc ((n + 1) * sizeof (char));
+ tmpstream->ts_strbuf = XNEWVEC (char, n + 1);
tmpstream->ts_strbuf[0] = '\0';
}
else
@@ -221,12 +221,13 @@ tui_file_adjust_strbuf (int n, struct ui_file *file)
if (n > (stream->ts_buflen - non_null_chars - 1))
{
stream->ts_buflen = n + non_null_chars + 1;
- stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen);
+ stream->ts_strbuf
+ = XRESIZEVEC (char, stream->ts_strbuf, stream->ts_buflen);
}
}
else
/* No buffer yet, so allocate one of the desired size. */
- stream->ts_strbuf = xmalloc ((n + 1) * sizeof (char));
+ stream->ts_strbuf = XNEWVEC (char, n + 1);
}
static void
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index c7a092f..6f81f09 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -671,7 +671,7 @@ tui_expand_tabs (const char *string, int col)
}
/* Allocate the copy. */
- ret = q = xmalloc (strlen (string) + n_adjust + 1);
+ ret = q = (char *) xmalloc (strlen (string) + n_adjust + 1);
/* 2. Copy the original string while replacing TABs with spaces. */
for (ncol = col, s = string; s; )
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 018a1df..9f40781 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -62,7 +62,7 @@ tui_set_source_content (struct symtab *s,
if (!noerror)
{
const char *filename = symtab_to_filename_for_display (s);
- char *name = alloca (strlen (filename) + 100);
+ char *name = (char *) alloca (strlen (filename) + 100);
sprintf (name, "%s:%d", filename, line_no);
print_sys_errmsg (name, errno);