diff options
author | 2022-06-29 21:35:21 +0200 | |
---|---|---|
committer | 2022-07-01 13:05:58 +0200 | |
commit | 9e8866ae20b0999b54fda9a52644ac937fedc0a1 (patch) | |
tree | bab71e249fb195e5089cf5d3d477b1b4240bae2d | |
parent | Strip quotes in bindsym --input-device=... (diff) | |
download | sway-9e8866ae20b0999b54fda9a52644ac937fedc0a1.tar.gz sway-9e8866ae20b0999b54fda9a52644ac937fedc0a1.tar.zst sway-9e8866ae20b0999b54fda9a52644ac937fedc0a1.zip |
Avoid unecessary string copy
-rw-r--r-- | sway/commands/font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands/font.c b/sway/commands/font.c index cea720f5..3eda0a9c 100644 --- a/sway/commands/font.c +++ b/sway/commands/font.c | |||
@@ -16,12 +16,12 @@ struct cmd_results *cmd_font(int argc, char **argv) { | |||
16 | if (strncmp(font, "pango:", 6) == 0) { | 16 | if (strncmp(font, "pango:", 6) == 0) { |
17 | config->pango_markup = true; | 17 | config->pango_markup = true; |
18 | config->font = strdup(font + 6); | 18 | config->font = strdup(font + 6); |
19 | free(font); | ||
19 | } else { | 20 | } else { |
20 | config->pango_markup = false; | 21 | config->pango_markup = false; |
21 | config->font = strdup(font); | 22 | config->font = font; |
22 | } | 23 | } |
23 | 24 | ||
24 | free(font); | ||
25 | config_update_font_height(); | 25 | config_update_font_height(); |
26 | return cmd_results_new(CMD_SUCCESS, NULL); | 26 | return cmd_results_new(CMD_SUCCESS, NULL); |
27 | } | 27 | } |