diff options
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 045802e1..39d1d0a7 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -64,7 +64,7 @@ void ipc_init(struct sway_server *server) { // 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)); + strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path) - 1); ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0; } |