Replace uses of concat with xstrdup
authorTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 16:00:52 +0000 (10:00 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 16:00:52 +0000 (10:00 -0600)
I noticed a couple of spots using concat that could use xstrdup
instead.  This patch fixes these.

gdb/ChangeLog
2019-06-16  Tom Tromey  <tom@tromey.com>

* coffread.c (process_coff_symbol): Use xstrdup.
* value.c (create_internalvar): Use xstrdup.

gdb/ChangeLog
gdb/coffread.c
gdb/value.c

index c6d4e32a3ca015f56a88c9d8e43db7911ef13900..1cf2b9bcdc8bbce90c30fd078eb893ca5dd1d958 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-16  Tom Tromey  <tom@tromey.com>
+
+       * coffread.c (process_coff_symbol): Use xstrdup.
+       * value.c (create_internalvar): Use xstrdup.
+
 2019-06-16  Tom Tromey  <tom@tromey.com>
 
        * valops.c (value_cast, value_slice): Remove unnecessary cast.
index 8b31200545dd0b9941fd5c339774b6571d5bf3d6..0c7c4b58b6fdc01c22093c533102b74a464ff087 100644 (file)
@@ -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;
index 71030efed072d69a50786812b35d573a0628e35e..1b22cf916e3c921bb33e7afcba016626621de1af 100644 (file)
@@ -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;