aboutsummaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2012-11-20 22:51:05 +0000
committerPierre Muller <muller@sourceware.org>2012-11-20 22:51:05 +0000
commit8c042590f977f3f8da4a8e9357ab4c11a7363438 (patch)
treea4021a2092bbe240166b2c4b455e3bc1b707f057 /gdb/sol-thread.c
parentdda8ddc56f160befb8f8fc3ddc69d66cec6ac4f8 (diff)
downloadgdb-8c042590f977f3f8da4a8e9357ab4c11a7363438.zip
gdb-8c042590f977f3f8da4a8e9357ab4c11a7363438.tar.gz
gdb-8c042590f977f3f8da4a8e9357ab4c11a7363438.tar.bz2
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/sol-thread.c')
-rw-r--r--gdb/sol-thread.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index b2c1806..b627741 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -196,7 +196,8 @@ td_err_string (td_err_e errcode)
if (td_err_table[i].num == errcode)
return td_err_table[i].str;
- sprintf (buf, "Unknown libthread_db error code: %d", errcode);
+ xsnprintf (buf, sizeof (buf), "Unknown libthread_db error code: %d",
+ errcode);
return buf;
}
@@ -227,7 +228,8 @@ td_state_string (td_thr_state_e statecode)
if (td_thr_state_table[i].num == statecode)
return td_thr_state_table[i].str;
- sprintf (buf, "Unknown libthread_db state code: %d", statecode);
+ xsnprintf (buf, sizeof (buf), "Unknown libthread_db state code: %d",
+ statecode);
return buf;
}
@@ -1015,17 +1017,18 @@ solaris_pid_to_str (struct target_ops *ops, ptid_t ptid)
lwp = thread_to_lwp (ptid, -2);
if (PIDGET (lwp) == -1)
- sprintf (buf, "Thread %ld (defunct)", GET_THREAD (ptid));
+ xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
+ GET_THREAD (ptid));
else if (PIDGET (lwp) != -2)
- sprintf (buf, "Thread %ld (LWP %ld)",
+ xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
GET_THREAD (ptid), GET_LWP (lwp));
else
- sprintf (buf, "Thread %ld ", GET_THREAD (ptid));
+ xsnprintf (buf, sizeof (buf), "Thread %ld ", GET_THREAD (ptid));
}
else if (GET_LWP (ptid) != 0)
- sprintf (buf, "LWP %ld ", GET_LWP (ptid));
+ xsnprintf (buf, sizeof (buf), "LWP %ld ", GET_LWP (ptid));
else
- sprintf (buf, "process %d ", PIDGET (ptid));
+ xsnprintf (buf, sizeof (buf), "process %d ", PIDGET (ptid));
return buf;
}