aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/ipc-server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 4d9264e8..a9325a81 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -66,6 +66,7 @@ void ipc_init(void) {
// We want to use socket name set by user, not existing socket from another sway instance.
if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) {
strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path));
+ ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0;
}
unlink(ipc_sockaddr->sun_path);