aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 0641efd..a8ee933 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3603,7 +3603,6 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
char psargs[80] = {'\0'};
procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
gdb::unique_xmalloc_ptr<char> note_data;
- const char *inf_args;
enum gdb_signal stop_signal;
if (get_exec_file (0))
@@ -3613,14 +3612,13 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
strncpy (psargs, get_exec_file (0), sizeof (psargs));
psargs[sizeof (psargs) - 1] = 0;
- inf_args = current_inferior ()->args ();
- if (inf_args && *inf_args
- && (strlen (inf_args)
- < ((int) sizeof (psargs) - (int) strlen (psargs))))
+ const std::string &inf_args = current_inferior ()->args ();
+ if (!inf_args.empty () &&
+ inf_args.length () < ((int) sizeof (psargs) - (int) strlen (psargs)))
{
strncat (psargs, " ",
sizeof (psargs) - strlen (psargs));
- strncat (psargs, inf_args,
+ strncat (psargs, inf_args.c_str (),
sizeof (psargs) - strlen (psargs));
}
}