diff options
author | Kenny Levinsen <kl@kl.wtf> | 2022-02-21 21:27:14 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2022-02-21 21:27:14 +0100 |
commit | ed90ed62cdf1c4e7d59e4d279a5bf946b93057dd (patch) | |
tree | 90cb831b059a1054077e0d4fa1860f90fb09c1b2 /seatd-launch | |
parent | a44476ce65af5c192860130cb25b0ce17cec2651 (diff) |
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.
Diffstat (limited to 'seatd-launch')
-rw-r--r-- | seatd-launch/seatd-launch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/seatd-launch/seatd-launch.c b/seatd-launch/seatd-launch.c index 4f15616..8057ba7 100644 --- a/seatd-launch/seatd-launch.c +++ b/seatd-launch/seatd-launch.c @@ -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) { |