aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c2
-rw-r--r--sway/commands/exec_always.c2
-rw-r--r--sway/ipc-server.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 54d84450..99f42524 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -601,7 +601,7 @@ struct cmd_results *add_color(const char *name,
"Invalid color definition %s", color);
}
}
- strncpy(buffer, color, len);
+ strcpy(buffer, color);
// add default alpha channel if color was defined without it
if (len == 7) {
buffer[7] = 'f';
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 954950e7..af4e4965 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -32,7 +32,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
// Put argument into cmd array
char cmd[4096];
- strncpy(cmd, tmp, sizeof(cmd));
+ strncpy(cmd, tmp, sizeof(cmd) - 1);
cmd[sizeof(cmd) - 1] = 0;
free(tmp);
wlr_log(L_DEBUG, "Executing %s", cmd);
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) {
// 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;
}