Use ui_file_as_string throughout more
[deliverable/binutils-gdb.git] / gdb / typeprint.c
index 6851a703888c02546c6e4d3d5cf8666074f95671..c1b46beb88aeb2fd06caf82ea3aa5db3aec4a6fc 100644 (file)
@@ -368,10 +368,10 @@ type_print (struct type *type, const char *varstring, struct ui_file *stream,
 /* Print TYPE to a string, returning it.  The caller is responsible for
    freeing the string.  */
 
-char *
+std::string
 type_to_string (struct type *type)
 {
-  char *s = NULL;
+  std::string s;
   struct ui_file *stb;
   struct cleanup *old_chain;
 
@@ -381,11 +381,10 @@ type_to_string (struct type *type)
   TRY
     {
       type_print (type, "", stb, -1);
-      s = ui_file_xstrdup (stb, NULL);
+      s = ui_file_as_string (stb);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
-      s = NULL;
     }
   END_CATCH
 
This page took 0.025359 seconds and 4 git commands to generate.