diff options
author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2022-06-29 21:35:21 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-07-01 13:05:58 +0200 |
commit | 9e8866ae20b0999b54fda9a52644ac937fedc0a1 (patch) | |
tree | bab71e249fb195e5089cf5d3d477b1b4240bae2d | |
parent | a55472c6d882d806e9d6fc0a78a7f7d8f888492e (diff) |
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) { if (strncmp(font, "pango:", 6) == 0) { config->pango_markup = true; config->font = strdup(font + 6); + free(font); } else { config->pango_markup = false; - config->font = strdup(font); + config->font = font; } - free(font); config_update_font_height(); return cmd_results_new(CMD_SUCCESS, NULL); } |