gdb
[deliverable/binutils-gdb.git] / gdb / dfp.c
index 9816d272e89bf8350737b5f9346d5d20bf5a8ea0..92d7daad6a6359282e91d9545eff2c71f4409ef2 100644 (file)
--- a/gdb/dfp.c
+++ b/gdb/dfp.c
@@ -1,6 +1,6 @@
 /* Decimal floating point support for GDB.
 
-   Copyright 2007, 2008 Free Software Foundation, Inc.
+   Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -235,16 +235,12 @@ void
 decimal_from_floating (struct value *from, gdb_byte *to, int len)
 {
   char *buffer;
-  int ret;
 
-  ret = asprintf (&buffer, "%.30" DOUBLEST_PRINT_FORMAT,
-                 value_as_double (from));
-  if (ret < 0)
-    error (_("Error in memory allocation for conversion to decimal float."));
+  buffer = xstrprintf ("%.30" DOUBLEST_PRINT_FORMAT, value_as_double (from));
 
   decimal_from_string (to, len, buffer);
 
-  free (buffer);
+  xfree (buffer);
 }
 
 /* Converts a decimal float of LEN bytes to a double value.  */
This page took 0.024276 seconds and 4 git commands to generate.