Replace some uses of xstrprintf with string_printf
[deliverable/binutils-gdb.git] / gdb / infcall.c
index c995ab7c9185d30296bffc50dec9016454dc77a7..b2d1205faaff6a16425334a5be35750e81e35f6e 100644 (file)
@@ -385,13 +385,11 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size)
   }
 
   {
-    char *tmp = xstrprintf (_(RAW_FUNCTION_ADDRESS_FORMAT),
-                            hex_string (funaddr));
+    std::string tmp = string_printf (_(RAW_FUNCTION_ADDRESS_FORMAT),
+                                    hex_string (funaddr));
 
-    gdb_assert (strlen (tmp) + 1 <= buf_size);
-    strcpy (buf, tmp);
-    xfree (tmp);
-    return buf;
+    gdb_assert (tmp.length () + 1 <= buf_size);
+    return strcpy (buf, tmp.c_str ());
   }
 }
 
This page took 0.028685 seconds and 4 git commands to generate.