GDB: Replace use of sprintf.
2005-03-17 Mark Kettenis <kettenis@gnu.org> * corelow.c (get_core_register_section): Replace usage of sprintf and strcpy with xstrprintf and xstrdup. Sourceware commit: 3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a
This commit is contained in:
parent
8f22878901
commit
8d2edb694b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/gdb/dist/; revision=277658
@ -432,15 +432,16 @@ get_core_register_section (char *name,
|
|||||||
char *human_name,
|
char *human_name,
|
||||||
int required)
|
int required)
|
||||||
{
|
{
|
||||||
char section_name[100];
|
static char *section_name = NULL;
|
||||||
struct bfd_section *section;
|
struct bfd_section *section;
|
||||||
bfd_size_type size;
|
bfd_size_type size;
|
||||||
char *contents;
|
char *contents;
|
||||||
|
|
||||||
|
xfree (section_name);
|
||||||
if (PIDGET (inferior_ptid))
|
if (PIDGET (inferior_ptid))
|
||||||
sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
|
section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid));
|
||||||
else
|
else
|
||||||
strcpy (section_name, name);
|
section_name = xstrdup (name);
|
||||||
|
|
||||||
section = bfd_get_section_by_name (core_bfd, section_name);
|
section = bfd_get_section_by_name (core_bfd, section_name);
|
||||||
if (! section)
|
if (! section)
|
||||||
|
Loading…
Reference in New Issue
Block a user