sway: always terminate ipc path

This commit is contained in:
Eric Engestrom 2016-05-02 11:24:00 +01:00
parent d3f3619c3a
commit 3d6a3413b8

View File

@ -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);