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 7cffe0797f
commit 615c10c75d

View file

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