]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/printcmd.c
Clean up some DFP interfaces
[thirdparty/binutils-gdb.git] / gdb / printcmd.c
index 994259d2dc58d7350a2f8bdd59884429c9bf455c..a8743f1f71fe8c6073059c9421881fbf7dd494a2 100644 (file)
@@ -2307,7 +2307,6 @@ printf_decfloat (struct ui_file *stream, const char *format,
   int dfp_len = 16;
   gdb_byte dec[16];
   struct type *dfp_type = NULL;
-  char decstr[MAX_DECIMAL_STRING];
 
   /* Points to the end of the string so that we can go back
      and check for DFP length modifiers.  */
@@ -2355,10 +2354,9 @@ printf_decfloat (struct ui_file *stream, const char *format,
 
   dfp_ptr = (gdb_byte *) value_contents (dfp_value);
 
-  decimal_to_string (dfp_ptr, dfp_len, byte_order, decstr);
-
-  /* Print the DFP value.  */
-  fprintf_filtered (stream, "%s", decstr);
+  /* Convert the value to a string and print it.  */
+  std::string str = decimal_to_string (dfp_ptr, dfp_len, byte_order);
+  fputs_filtered (str.c_str (), stream);
 #endif
 }