From: Tom Tromey Date: Sun, 16 Jun 2019 16:00:52 +0000 (-0600) Subject: Replace uses of concat with xstrdup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=395f9c911460b3e868c0b700e831c7f92746fad7;p=binutils-gdb.git Replace uses of concat with xstrdup I noticed a couple of spots using concat that could use xstrdup instead. This patch fixes these. gdb/ChangeLog 2019-06-16 Tom Tromey * coffread.c (process_coff_symbol): Use xstrdup. * value.c (create_internalvar): Use xstrdup. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c6d4e32a3ca..1cf2b9bcdc8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-06-16 Tom Tromey + + * coffread.c (process_coff_symbol): Use xstrdup. + * value.c (create_internalvar): Use xstrdup. + 2019-06-16 Tom Tromey * valops.c (value_cast, value_slice): Remove unnecessary cast. diff --git a/gdb/coffread.c b/gdb/coffread.c index 8b31200545d..0c7c4b58b6f 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1728,7 +1728,7 @@ process_coff_symbol (struct coff_symbol *cs, && *SYMBOL_LINKAGE_NAME (sym) != '~' && *SYMBOL_LINKAGE_NAME (sym) != '.') TYPE_NAME (SYMBOL_TYPE (sym)) = - concat (SYMBOL_LINKAGE_NAME (sym), (char *)NULL); + xstrdup (SYMBOL_LINKAGE_NAME (sym)); add_symbol_to_list (sym, get_file_symbols ()); break; diff --git a/gdb/value.c b/gdb/value.c index 71030efed07..1b22cf916e3 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2025,7 +2025,7 @@ create_internalvar (const char *name) { struct internalvar *var = XNEW (struct internalvar); - var->name = concat (name, (char *)NULL); + var->name = xstrdup (name); var->kind = INTERNALVAR_VOID; var->next = internalvars; internalvars = var;