PR binutils/1437
[deliverable/binutils-gdb.git] / gdb / cp-abi.c
index 2b39300e4d2f6504a8793b421e111bae2d49c4c5..f5077856569ea23b2de4d760ec484ebb8dc17ee4 100644 (file)
@@ -145,14 +145,11 @@ set_cp_abi_as_auto_default (const char *short_name)
   auto_cp_abi = *abi;
 
   auto_cp_abi.shortname = "auto";
-  new_longname = xmalloc (strlen ("currently ") + 1 + strlen (abi->shortname)
-                         + 1 + 1);
-  sprintf (new_longname, "currently \"%s\"", abi->shortname);
+  xasprintf (&new_longname, "currently \"%s\"", abi->shortname);
   auto_cp_abi.longname = new_longname;
 
-  new_doc = xmalloc (strlen ("Automatically selected; currently ")
-                    + 1 + strlen (abi->shortname) + 1 + 1);
-  sprintf (new_doc, "Automatically selected; currently \"%s\"", abi->shortname);
+  xasprintf (&new_doc, "Automatically selected; currently \"%s\"",
+            abi->shortname);
   auto_cp_abi.doc = new_doc;
 
   /* Since we copy the current ABI into current_cp_abi instead of
This page took 0.023063 seconds and 4 git commands to generate.