sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 9e8866ae20b0999b54fda9a52644ac937fedc0a1
parent a55472c6d882d806e9d6fc0a78a7f7d8f888492e
Author: Hugo Osvaldo Barrera <hugo@barrera.io>
Date:   Wed, 29 Jun 2022 21:35:21 +0200

Avoid unecessary string copy

Diffstat:
Msway/commands/font.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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); }