diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-05-02 08:14:01 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-05-02 08:14:01 -0400 |
commit | 0cefde87e485141bc59809574736e05ddbdb2448 (patch) | |
tree | 7977ecbdd47956f5d7c449f8e01c6b41926a34eb | |
parent | Merge pull request #629 from cyberhuman/master (diff) | |
parent | sway: always terminate ipc path (diff) | |
download | sway-0cefde87e485141bc59809574736e05ddbdb2448.tar.gz sway-0cefde87e485141bc59809574736e05ddbdb2448.tar.zst sway-0cefde87e485141bc59809574736e05ddbdb2448.zip |
Merge pull request #628 from 1ace/fix/ipc-path
Always terminate ipc path
-rw-r--r-- | sway/ipc-server.c | 1 |
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); |