Skip to content

Commit

Permalink
Avoid unecessary string copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Osvaldo Barrera authored and kraftwerk28 committed Aug 7, 2022
1 parent 9f334e9 commit fd1f8b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sway/commands/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit fd1f8b7

Please sign in to comment.