From 212e4ef39518c4bb29eeef46f705770d3d28a6fc Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Thu, 7 Jun 2018 20:37:08 -0400 Subject: Remove strip quoting and fix strncpy-overlap --- sway/commands.c | 1 - sway/config.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index 464c9932..1523fdd1 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -274,7 +274,6 @@ struct cmd_results *execute_command(char *_exec, struct sway_seat *seat) { for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) { argv[i] = do_var_replacement(argv[i]); unescape_string(argv[i]); - strip_quotes(argv[i]); } if (!config->handler_context.using_criteria) { diff --git a/sway/config.c b/sway/config.c index 0e41df04..949c5cd3 100644 --- a/sway/config.c +++ b/sway/config.c @@ -660,7 +660,7 @@ char *do_var_replacement(char *str) { // Unescape double $ and move on if (find[1] == '$') { size_t length = strlen(find + 1); - strncpy(find, find + 1, length); + memmove(find, find + 1, length); find[length] = '\0'; ++find; continue; -- cgit v1.2.3-54-g00ecf