seatd-launch: Use snprintf for socket path

We also reduce the size of the buffer from 256 bytes to a much more
reasonable 32 bytes.
This commit is contained in:
Kenny Levinsen 2022-02-21 21:27:14 +01:00
parent a44476ce65
commit ed90ed62cd

View file

@ -42,8 +42,8 @@ int main(int argc, char *argv[]) {
}
char **command = &argv[optind];
char sockpath[256];
sprintf(sockpath, "/tmp/seatd.%d.sock", getpid());
char sockpath[32];
snprintf(sockpath, sizeof sockpath, "/tmp/seatd.%d.sock", getpid());
int fds[2];
if (pipe(fds) == -1) {