diff options
author | emersion <contact@emersion.fr> | 2018-04-15 07:42:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-15 07:42:38 +0200 |
commit | 3ea2a9a85e7db6e9858ccf68a67b312cd6db36c5 (patch) | |
tree | 9d81001776f4e095de76a63d540ab1ab0ca45caf /common/ipc-client.c | |
parent | dcecfe6a996c89988f7639493395ebe224f8d9a8 (diff) | |
parent | 0feb25e0283657087dd73a06c1b5ae891e0896b3 (diff) |
Merge pull request #1811 from martinetd/gcc_warnings
Fix gcc warnings
Diffstat (limited to 'common/ipc-client.c')
-rw-r--r-- | common/ipc-client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/ipc-client.c b/common/ipc-client.c index 117e9910..a88df080 100644 --- a/common/ipc-client.c +++ b/common/ipc-client.c @@ -48,7 +48,7 @@ int ipc_open_socket(const char *socket_path) { sway_abort("Unable to open Unix socket"); } addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path)); + strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1); addr.sun_path[sizeof(addr.sun_path) - 1] = 0; int l = sizeof(struct sockaddr_un); if (connect(socketfd, (struct sockaddr *)&addr, l) == -1) { |