diff options
author | Pierre Muller <muller@sourceware.org> | 2012-11-20 22:51:05 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2012-11-20 22:51:05 +0000 |
commit | 8c042590f977f3f8da4a8e9357ab4c11a7363438 (patch) | |
tree | a4021a2092bbe240166b2c4b455e3bc1b707f057 /gdb/tui | |
parent | dda8ddc56f160befb8f8fc3ddc69d66cec6ac4f8 (diff) | |
download | binutils-gdb-8c042590f977f3f8da4a8e9357ab4c11a7363438.tar.gz |
ARI fixes: sprintf rule.
Replace sprintf function calls for char arrays by
calls to xsnprintf calls.
* arm-tdep.c (arm_push_dummy_call): Replace sprintf by xsnprintf.
(arm_dwarf_reg_to_regnum, arm_return_value): Ditto.
(arm_neon_quad_read, arm_pseudo_read): Ditto.
(arm_neon_quad_write, arm_pseudo_write): Ditto.
* breakpoint.c (condition_completer): Ditto.
(create_tracepoint_from_upload): Ditto.
* dwarf2read.c (file_full_name): Ditto.
* gcore.c (gcore_command): Ditto.
* gnu-nat.c (proc_string, gnu_pid_to_str): Ditto.
* go32-nat.c (go32_sysinfo): Ditto.
* interps.c (interp_set): Ditto.
* m32c-tdep.c (make_types): Ditto.
* ppc-linux-nat.c (fetch_register, store_register): Ditto.
* remote-m32r-sdi.c (m32r_open): Ditto.
* sol-thread.c (td_err_string): Ditto.
(td_state_string, solaris_pid_to_str): Ditto.
* symtab.c (gdb_mangle_name): Ditto.
* cli/cli-script.c (execute_control_command): Ditto.
(define_command, document_command): Ditto.
* tui/tui-io.c (tui_rl_display_match_list): Ditto.
* tui/tui-stack.c (tui_make_status_line): Ditto.
* tui/tui-win.c (tui_update_gdb_sizes): Ditto.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-io.c | 3 | ||||
-rw-r--r-- | gdb/tui/tui-stack.c | 2 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 29c1a2c6fb5..fe88f1a52cc 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -419,7 +419,8 @@ tui_rl_display_match_list (char **matches, int len, int max) { char msg[256]; - sprintf (msg, "\nDisplay all %d possibilities? (y or n)", len); + xsnprintf (msg, sizeof (msg), + "\nDisplay all %d possibilities? (y or n)", len); tui_puts (msg); if (get_y_or_n () == 0) { diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 262a6bf3143..2cd6678ce84 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -94,7 +94,7 @@ tui_make_status_line (struct tui_locator_element *loc) /* Translate line number and obtain its size. */ if (loc->line_no > 0) - sprintf (line_buf, "%d", loc->line_no); + xsnprintf (line_buf, sizeof (line_buf), "%d", loc->line_no); else strcpy (line_buf, "??"); line_width = strlen (line_buf); diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index c12f036d501..f611f30e1d2 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -466,10 +466,10 @@ tui_update_gdb_sizes (void) char cmd[50]; /* Set to TUI command window dimension or use readline values. */ - sprintf (cmd, "set width %d", + xsnprintf (cmd, sizeof (cmd), "set width %d", tui_active ? TUI_CMD_WIN->generic.width : tui_term_width()); execute_command (cmd, 0); - sprintf (cmd, "set height %d", + xsnprintf (cmd, sizeof (cmd), "set height %d", tui_active ? TUI_CMD_WIN->generic.height : tui_term_height()); execute_command (cmd, 0); } |