aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-03-17 22:07:42 +0000
committerMark Kettenis <kettenis@gnu.org>2005-03-17 22:07:42 +0000
commit3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a (patch)
tree112a7c30ca645152fa75a2afdf2427c8e0910943 /gdb
parent30f725a1cfc586c6d5aed63218e9a3b378848bc5 (diff)
downloadfsf-binutils-gdb-3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a.zip
fsf-binutils-gdb-3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a.tar.gz
fsf-binutils-gdb-3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a.tar.bz2
* corelow.c (get_core_register_section): Replace usage of sprintf
and strcpy with xstrprintf and xstrdup.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/corelow.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 91ee65e..3c62956c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2005-03-17 Mark Kettenis <kettenis@gnu.org>
+ * corelow.c (get_core_register_section): Replace usage of sprintf
+ and strcpy with xstrprintf and xstrdup.
+
* mips-tdep.c (mips_single_step_through_delay): Put back check for
breakpoint lost with the introduction of this function.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index ebc068f..a78f71a 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -447,15 +447,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)