From 25af959fe96441123f8ab492427a9390af384918 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 13 Apr 2018 22:35:23 +0900 Subject: Fix gcc string truncation warnings --- sway/commands/exec_always.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/exec_always.c') 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); -- cgit v1.2.3