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 /common | |
parent | 54ae394754533295627eacb8b26a579bc051dda9 (diff) |
Fix gcc string truncation warnings
Diffstat (limited to 'common')
-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) { |