commit 0cefde87e485141bc59809574736e05ddbdb2448
parent 7f8d596bb515bba4a4b8e5b76db7e16e661c6641
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 2 May 2016 08:14:01 -0400
Merge pull request #628 from 1ace/fix/ipc-path
Always terminate ipc path
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git 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);