This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/Ada/ARI] Remove one use of sprintf in ada-lang.c (print_it_exception)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Wed, 18 May 2011 10:30:37 -0700
- Subject: [commit/Ada/ARI] Remove one use of sprintf in ada-lang.c (print_it_exception)
This is just a minor cleanup of an ARI violation. As this affects
code that is normally unreachable (you'd need a runtime where
the unit providing the exception hook has been compiled without
debugging information), I tested this manually by commenting out
the code just above, thus forcing this part of the code to be
exercised.
gdb/ChangeLog:
* ada-lang.c (print_it_exception): Avoid use of sprintf.
Tested on x86_64-linux. Checked in.
--
Joel
---
gdb/ChangeLog | 4 ++++
gdb/ada-lang.c | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d7a31a6..0538dd7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2011-05-18 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (print_it_exception): Avoid use of sprintf.
+
2011-05-18 Tom Tromey <tromey@redhat.com>
* value.c (value_fn_field): Constify.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index ebd5fd2..0435d33 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10783,7 +10783,7 @@ print_it_exception (enum exception_catchpoint_kind ex, struct breakpoint *b)
just replace the exception name by the generic string
"exception" - it will read as "an exception" in the
notification we are about to print. */
- sprintf (exception_name, "exception");
+ memcpy (exception_name, "exception", sizeof ("exception"));
}
/* In the case of unhandled exception breakpoints, we print
the exception name as "unhandled EXCEPTION_NAME", to make
--
1.7.1