mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-04-18 03:50:49 +02:00
util: use snprintf for PID formatting in backtrace helper
Use snprintf to make analyziers happier and bump the buffer size to 16. That's way larger than we'll need given the kernel's PID_MAX_LIMIT (4194304) but it doesn't cost us anything. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1465>
This commit is contained in:
parent
e32202eeae
commit
9d8a8b4530
1 changed files with 2 additions and 2 deletions
|
|
@ -65,12 +65,12 @@ backtrace_print(FILE *fp,
|
|||
child = fork();
|
||||
|
||||
if (child == 0) {
|
||||
char pid[8];
|
||||
char pid[16];
|
||||
|
||||
close(pipefd[0]);
|
||||
dup2(pipefd[1], STDOUT_FILENO);
|
||||
|
||||
sprintf(pid, "%d", parent);
|
||||
snprintf(pid, sizeof(pid), "%d", parent);
|
||||
|
||||
execlp("gstack", "gstack", pid, NULL);
|
||||
exit(errno);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue