diff options
author | Mark Kettenis <kettenis@gnu.org> | 2005-03-13 22:06:10 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2005-03-13 22:06:10 +0000 |
commit | 279eca0814842ee5d0c1a5b3724b50fcf9b56aff (patch) | |
tree | 2800a035df218152c00c6d0288b93c4c4c656f69 /gdb/inf-ttrace.c | |
parent | 8cb68fbb05cccb6faea70910cde1228b661f2474 (diff) | |
download | gdb-279eca0814842ee5d0c1a5b3724b50fcf9b56aff.tar.gz |
* 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.
Diffstat (limited to 'gdb/inf-ttrace.c')
-rw-r--r-- | gdb/inf-ttrace.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index 253323824b9..7e3e79ac75d 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -908,9 +908,12 @@ inf_ttrace_pid_to_str (ptid_t ptid) { pid_t pid = ptid_get_pid (ptid); lwpid_t lwpid = ptid_get_lwp (ptid); - static char buf[80]; + static char buf[128]; + int size; - sprintf (buf, "process %ld, lwp %ld", (long)pid, (long)lwpid); + size = snprintf (buf, sizeof buf, "process %ld, lwp %ld", + (long)pid, (long)lwpid); + gdb_assert (size < sizeof buf); return buf; } |