mirror of
https://github.com/swaywm/sway.git
synced 2025-11-19 06:59:52 -05:00
Fix gcc string truncation warnings
This commit is contained in:
parent
54ae394754
commit
25af959fe9
4 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue