summaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorLibravatar Eric Engestrom <eric@engestrom.ch>2016-05-02 11:24:00 +0100
committerLibravatar Eric Engestrom <eric@engestrom.ch>2016-05-02 11:26:27 +0100
commit3d6a3413b831829c4b09bf4901b620bc5c023ddd (patch)
tree6c5e40d8de9229f3f40947baa5886aeeb7a22403 /sway/ipc-server.c
parentMerge pull request #627 from mikkeloscar/update-title-when-tabbed (diff)
downloadsway-3d6a3413b831829c4b09bf4901b620bc5c023ddd.tar.gz
sway-3d6a3413b831829c4b09bf4901b620bc5c023ddd.tar.zst
sway-3d6a3413b831829c4b09bf4901b620bc5c023ddd.zip
sway: always terminate ipc path
Diffstat (limited to 'sway/ipc-server.c')
-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) {
66 // We want to use socket name set by user, not existing socket from another sway instance. 66 // We want to use socket name set by user, not existing socket from another sway instance.
67 if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) { 67 if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) {
68 strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path)); 68 strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path));
69 ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0;
69 } 70 }
70 71
71 unlink(ipc_sockaddr->sun_path); 72 unlink(ipc_sockaddr->sun_path);