diff options
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 2533238..7e3e79a 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; } |