]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use ui_file_as_string in gdb/utils.c
authorPedro Alves <palves@redhat.com>
Tue, 8 Nov 2016 15:26:44 +0000 (15:26 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 8 Nov 2016 15:26:44 +0000 (15:26 +0000)
gdb/ChangeLog:
2016-11-08  Pedro Alves  <palves@redhat.com>

* utils.c (error_stream): Use ui_file_as_string and std::string.

gdb/ChangeLog
gdb/utils.c

index 78557768238173acdf0c79839cd2fbd7999667e8..769187fad9bee79de5ea079ba1170540432c1226 100644 (file)
@@ -1,3 +1,7 @@
+2016-11-08  Pedro Alves  <palves@redhat.com>
+
+       * utils.c (error_stream): Use ui_file_as_string and std::string.
+
 2016-11-08  Pedro Alves  <palves@redhat.com>
 
        * ui-out.c (ui_out_field_stream): Use ui_file_as_string.
index c7ba05197d2c1fe7ac4849c1ca44282dce4be6c5..751f09949d624da8c10d20e279d60d114028dc63 100644 (file)
@@ -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.  */