diff options
author | Reza Jelveh <[email protected]> | 2024-04-15 13:39:41 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-15 01:39:41 -0400 |
commit | fb86ed6b0588dfdebfb66ce875bc63cfa0a897f6 (patch) | |
tree | 29857a1769107adc58696f08d379f608aa4e29a2 /swaynag/config.c | |
parent | a5e79676c4bd22fc5902182acf0667907202a465 (diff) |
feat: 1.9 merge (#277)
Co-authored-by: William McKinnon <[email protected]>
Co-authored-by: Erik Reider <[email protected]>
Diffstat (limited to 'swaynag/config.c')
-rw-r--r-- | swaynag/config.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index db86c1b8..b355b153 100644 --- a/swaynag/config.c +++ b/swaynag/config.c @@ -166,7 +166,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, fprintf(stderr, "Missing action for button %s\n", optarg); return EXIT_FAILURE; } - struct swaynag_button *button = calloc(sizeof(struct swaynag_button), 1); + struct swaynag_button *button = calloc(1, sizeof(struct swaynag_button)); if (!button) { perror("calloc"); return EXIT_FAILURE; @@ -226,10 +226,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, break; case 'f': // Font if (type) { - free(type->font); pango_font_description_free(type->font_description); - type->font = strdup(optarg); - type->font_description = pango_font_description_from_string(type->font); + type->font_description = pango_font_description_from_string(optarg); } break; case 'l': // Detailed Message @@ -245,8 +243,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, break; case 'L': // Detailed Button Text if (swaynag) { - free(swaynag->details.button_details.text); - swaynag->details.button_details.text = strdup(optarg); + free(swaynag->details.details_text); + swaynag->details.details_text = strdup(optarg); } break; case 'm': // Message |