diff options
author | 2018-04-15 07:42:38 +0200 | |
---|---|---|
committer | 2018-04-15 07:42:38 +0200 | |
commit | 3ea2a9a85e7db6e9858ccf68a67b312cd6db36c5 (patch) | |
tree | 9d81001776f4e095de76a63d540ab1ab0ca45caf /common/ipc-client.c | |
parent | Merge pull request #1815 from ascent12/posix_source (diff) | |
parent | Merge branch 'master' into gcc_warnings (diff) | |
download | sway-3ea2a9a85e7db6e9858ccf68a67b312cd6db36c5.tar.gz sway-3ea2a9a85e7db6e9858ccf68a67b312cd6db36c5.tar.zst sway-3ea2a9a85e7db6e9858ccf68a67b312cd6db36c5.zip |
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) { | |||
48 | sway_abort("Unable to open Unix socket"); | 48 | sway_abort("Unable to open Unix socket"); |
49 | } | 49 | } |
50 | addr.sun_family = AF_UNIX; | 50 | addr.sun_family = AF_UNIX; |
51 | strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path)); | 51 | strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1); |
52 | addr.sun_path[sizeof(addr.sun_path) - 1] = 0; | 52 | addr.sun_path[sizeof(addr.sun_path) - 1] = 0; |
53 | int l = sizeof(struct sockaddr_un); | 53 | int l = sizeof(struct sockaddr_un); |
54 | if (connect(socketfd, (struct sockaddr *)&addr, l) == -1) { | 54 | if (connect(socketfd, (struct sockaddr *)&addr, l) == -1) { |