aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-16 10:00:52 -0600
committerTom Tromey <tom@tromey.com>2019-06-16 10:00:52 -0600
commit395f9c911460b3e868c0b700e831c7f92746fad7 (patch)
tree79b66e95f3a7c308b32721a3a73ab317050b39c7 /gdb
parentcafb34387d063fa47bc2cdb33fc3fe2f13e6cec0 (diff)
downloadgdb-395f9c911460b3e868c0b700e831c7f92746fad7.zip
gdb-395f9c911460b3e868c0b700e831c7f92746fad7.tar.gz
gdb-395f9c911460b3e868c0b700e831c7f92746fad7.tar.bz2
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 <tom@tromey.com> * coffread.c (process_coff_symbol): Use xstrdup. * value.c (create_internalvar): Use xstrdup.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/coffread.c2
-rw-r--r--gdb/value.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c6d4e32..1cf2b9b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
* breakpoint.c (stopin_command, stopat_command)
(until_break_command, decode_location_default): Remove unnecessary
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 8b31200..0c7c4b5 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 71030ef..1b22cf9 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;