summaryrefslogtreecommitdiff
path: root/gdb/complaints.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-27 20:54:17 -0600
committerTom Tromey <tom@tromey.com>2017-09-29 20:46:44 -0600
commit55b064321eed6cccf511fd698c732890e3ba4c6b (patch)
tree713bc7c31172c4fb275eacdd299172d3b0c3853e /gdb/complaints.c
parent8abcee91738bf0be98e949049c559839ef811ae4 (diff)
Remove cleanup from complaints.c
This removes a cleanup from complaints.c by using std::string. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * complaints.c (vcomplaint): Use std::string.
Diffstat (limited to 'gdb/complaints.c')
-rw-r--r--gdb/complaints.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c
index aba305c729..58b6b7b51c 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -192,16 +192,14 @@ vcomplaint (struct complaints **c, const char *file,
vwarning (fmt, args);
else
{
- char *msg;
- struct cleanup *cleanups;
- msg = xstrvprintf (fmt, args);
- cleanups = make_cleanup (xfree, msg);
+ std::string msg = string_vprintf (fmt, args);
wrap_here ("");
if (series != SUBSEQUENT_MESSAGE)
begin_line ();
/* XXX: i18n */
fprintf_filtered (gdb_stderr, "%s%s%s",
- complaints->explanation[series].prefix, msg,
+ complaints->explanation[series].prefix,
+ msg.c_str (),
complaints->explanation[series].postfix);
/* Force a line-break after any isolated message. For the
other cases, clear_complaints() takes care of any missing
@@ -214,7 +212,6 @@ vcomplaint (struct complaints **c, const char *file,
fputs_filtered ("\n", gdb_stderr);
else
wrap_here ("");
- do_cleanups (cleanups);
}
}