commit 3d6a3413b831829c4b09bf4901b620bc5c023ddd
parent d3f3619c3aed03ddd70afee41cb941320a551ed8
Author: Eric Engestrom <eric@engestrom.ch>
Date: Mon, 2 May 2016 11:24:00 +0100
sway: 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);