diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-01-24 21:00:51 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2015-01-24 21:00:51 +0000 |
commit | 8d2edb694b0b40cfefe7372c9116efe267b1f034 (patch) | |
tree | 95075645c4bd9494635262fa0a8c84e9fde261f8 | |
parent | 8f228789016acf40c01a73284a7d541ba58985e5 (diff) | |
download | src-test2-vendor/gdb.tar.gz src-test2-vendor/gdb.zip |
GDB: Replace use of sprintf.vendor/gdb
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
Notes
Notes:
svn path=/vendor/gdb/dist/; revision=277658
-rw-r--r-- | gdb/corelow.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c index 403cfa31338d..c06e6220dc8b 100644 --- a/gdb/corelow.c +++ b/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) |