From: Pedro Alves Date: Tue, 8 Nov 2016 15:26:44 +0000 (+0000) Subject: Use ui_file_as_string in gdb/utils.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d16c5475b560adbad2d9bc78ec3718658f4090e3;p=binutils-gdb.git Use ui_file_as_string in gdb/utils.c gdb/ChangeLog: 2016-11-08 Pedro Alves * utils.c (error_stream): Use ui_file_as_string and std::string. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 78557768238..769187fad9b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-11-08 Pedro Alves + + * utils.c (error_stream): Use ui_file_as_string and std::string. + 2016-11-08 Pedro Alves * ui-out.c (ui_out_field_stream): Use ui_file_as_string. diff --git a/gdb/utils.c b/gdb/utils.c index c7ba05197d2..751f09949d6 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -480,10 +480,9 @@ verror (const char *string, va_list args) void error_stream (struct ui_file *stream) { - char *message = ui_file_xstrdup (stream, NULL); + std::string message = ui_file_as_string (stream); - make_cleanup (xfree, message); - error (("%s"), message); + error (("%s"), message.c_str ()); } /* Emit a message and abort. */