From 8c042590f977f3f8da4a8e9357ab4c11a7363438 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Tue, 20 Nov 2012 22:51:05 +0000 Subject: 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. --- gdb/gnu-nat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/gnu-nat.c') diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index e6836d7..1d74d04 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2587,10 +2587,10 @@ proc_string (struct proc *proc) static char tid_str[80]; if (proc_is_task (proc)) - sprintf (tid_str, "process %d", proc->inf->pid); + xsnprintf (tid_str, sizeof (tid_str), "process %d", proc->inf->pid); else - sprintf (tid_str, "Thread %d.%d", - proc->inf->pid, proc->tid); + xsnprintf (tid_str, sizeof (tid_str), "Thread %d.%d", + proc->inf->pid, proc->tid); return tid_str; } @@ -2607,7 +2607,7 @@ gnu_pid_to_str (struct target_ops *ops, ptid_t ptid) { static char tid_str[80]; - sprintf (tid_str, "bogus thread id %d", tid); + xsnprintf (tid_str, sizeof (tid_str), "bogus thread id %d", tid); return tid_str; } } -- cgit v1.1