diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-13 22:35:23 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-13 22:47:27 +0900 |
commit | 25af959fe96441123f8ab492427a9390af384918 (patch) | |
tree | eac72167f123b908e1a3fc2120493d2b70fe3984 /sway/ipc-server.c | |
parent | Merge pull request #1810 from martinetd/wl_scanner (diff) | |
download | sway-25af959fe96441123f8ab492427a9390af384918.tar.gz sway-25af959fe96441123f8ab492427a9390af384918.tar.zst sway-25af959fe96441123f8ab492427a9390af384918.zip |
Fix gcc string truncation warnings
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) { | |||
64 | 64 | ||
65 | // We want to use socket name set by user, not existing socket from another sway instance. | 65 | // We want to use socket name set by user, not existing socket from another sway instance. |
66 | if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) { | 66 | if (getenv("SWAYSOCK") != NULL && access(getenv("SWAYSOCK"), F_OK) == -1) { |
67 | strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path)); | 67 | strncpy(ipc_sockaddr->sun_path, getenv("SWAYSOCK"), sizeof(ipc_sockaddr->sun_path) - 1); |
68 | ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0; | 68 | ipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0; |
69 | } | 69 | } |
70 | 70 | ||