summaryrefslogtreecommitdiffstats
path: root/contrib/gdb
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-01-24 21:05:18 +0000
committerpfg <pfg@FreeBSD.org>2015-01-24 21:05:18 +0000
commit58730a3555d007a8209b6467769a9bf14886e32c (patch)
tree1db8fdd01c13355db45cdfbf577d68ea1dfd0e43 /contrib/gdb
parent984840d5afc4461981c5bfc6a3ac5935278ee71a (diff)
downloadFreeBSD-src-58730a3555d007a8209b6467769a9bf14886e32c.zip
FreeBSD-src-58730a3555d007a8209b6467769a9bf14886e32c.tar.gz
MFV r277658:
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 CID: 1006819 MFC after: 4 days
Diffstat (limited to 'contrib/gdb')
-rw-r--r--contrib/gdb/gdb/corelow.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/gdb/gdb/corelow.c b/contrib/gdb/gdb/corelow.c
index 9e201cc..5517e1d 100644
--- a/contrib/gdb/gdb/corelow.c
+++ b/contrib/gdb/gdb/corelow.c
@@ -432,15 +432,16 @@ get_core_register_section (char *name,
char *human_name,
int required)
{
- char section_name[100];
+ static char *section_name = NULL;
struct bfd_section *section;
bfd_size_type size;
char *contents;
+ xfree (section_name);
if (PIDGET (inferior_ptid))
- sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
+ section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid));
else
- strcpy (section_name, name);
+ section_name = xstrdup (name);
section = bfd_get_section_by_name (core_bfd, section_name);
if (! section)
OpenPOWER on IntegriCloud