diff options
author | Mark Kettenis <kettenis@gnu.org> | 2005-03-13 19:55:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2005-03-13 19:55:38 +0000 |
commit | 049742daef2e31e791ee3497a8060a082997e566 (patch) | |
tree | 8bd60ffadf7a799772781451f6e57e10b652264a /gdb/cp-abi.c | |
parent | ca231fcc24d907f422ec6aff0529899543a58541 (diff) | |
download | gdb-049742daef2e31e791ee3497a8060a082997e566.zip gdb-049742daef2e31e791ee3497a8060a082997e566.tar.gz gdb-049742daef2e31e791ee3497a8060a082997e566.tar.bz2 |
* cp-abi.c (set_cp_abi_as_auto_default): Use xasprintf instead of
a combination of xmalloc and sprintf.
Diffstat (limited to 'gdb/cp-abi.c')
-rw-r--r-- | gdb/cp-abi.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 2b39300..f507785 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -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 |