* inf-ttrace.c (inf_ttrace_pid_to_str): Use snprintf instead of
sprintf. * target.c (normal_pid_to_str): Likewise. * remote.c (remote_pid_to_str): Use snprint instead of sprintf. Change capitalization of "thread". Use ptid_get_pid instead of GETPID.
This commit is contained in:
parent
049742daef
commit
fd0a2a6f0c
4 changed files with 23 additions and 9 deletions
10
gdb/target.c
10
gdb/target.c
|
@ -1803,15 +1803,17 @@ store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
|
|||
int (*target_activity_function) (void);
|
||||
int target_activity_fd;
|
||||
|
||||
/* Convert a normal process ID to a string. Returns the string in a static
|
||||
buffer. */
|
||||
/* Convert a normal process ID to a string. Returns the string in a
|
||||
static buffer. */
|
||||
|
||||
char *
|
||||
normal_pid_to_str (ptid_t ptid)
|
||||
{
|
||||
static char buf[30];
|
||||
static char buf[32];
|
||||
int size;
|
||||
|
||||
sprintf (buf, "process %d", PIDGET (ptid));
|
||||
size = snprintf (buf, sizeof buf, "process %d", ptid_get_pid (ptid));
|
||||
gdb_assert (size < sizeof buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue