From: Joel Brobecker Date: Tue, 27 Dec 2011 04:12:10 +0000 (+0000) Subject: remove use of sprintf in py-finishbreakpoint.c... X-Git-Tag: sid-snapshot-20120101~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41843fe8ff3cdc16b8c1448099f02cc19f362658;p=thirdparty%2Fbinutils-gdb.git remove use of sprintf in py-finishbreakpoint.c... ... 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4656b24d517..db084272284 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-12-27 Joel Brobecker + + * py-finishbreakpoint.c (bpfinishpy_init): Replace call to + sprintf by call to xsnprintf. + 2011-12-27 Joel Brobecker * linespec.c (struct collect_minsyms) [list_mode]: New field. diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index a2d816599e3..c158d472271 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -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,