Fix gcc string truncation warnings

This commit is contained in:
Dominique Martinet 2018-04-13 22:35:23 +09:00
parent 54ae394754
commit 25af959fe9
4 changed files with 4 additions and 4 deletions

View file

@ -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);