]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
remove use of sprintf in py-finishbreakpoint.c...
authorJoel Brobecker <brobecker@gnat.com>
Tue, 27 Dec 2011 04:12:10 +0000 (04:12 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 27 Dec 2011 04:12:10 +0000 (04:12 +0000)
... and replace it with call to xsnprintf, following GDB's coding rules.

gdb/ChangeLog:

        * py-finishbreakpoint.c (bpfinishpy_init): Replace call to
        sprintf by call to xsnprintf.

gdb/ChangeLog
gdb/python/py-finishbreakpoint.c

index 4656b24d5178f552d868a2f16f5bd4f8ba6c0415..db084272284991f0a19f0332fb87780bc812ebed 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-27  Joel Brobecker  <brobecker@adacore.com>
+
+       * py-finishbreakpoint.c (bpfinishpy_init): Replace call to
+       sprintf by call to xsnprintf.
+
 2011-12-27  Joel Brobecker  <brobecker@adacore.com>
 
        * linespec.c (struct collect_minsyms) [list_mode]: New field.
index a2d816599e3a7f2ebd97e4f1d02c502b7262b28c..c158d47227111aacf0a505d5cf5751e14e09d291 100644 (file)
@@ -277,7 +277,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
     {
       /* Set a breakpoint on the return address.  */
       finish_pc = get_frame_pc (prev_frame);
-      sprintf (small_buf, "*%s", hex_string (finish_pc));
+      xsnprintf (small_buf, sizeof (small_buf), "*%s", hex_string (finish_pc));
       addr_str = small_buf;
 
       create_breakpoint (python_gdbarch,