aboutsummaryrefslogtreecommitdiff
path: root/swaynag/main.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-08-25 13:06:04 +1000
committerGitHub <noreply@github.com>2018-08-25 13:06:04 +1000
commit4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9 (patch)
treef1ed7e866d4e34f5ef9b8f72ec8095369619aaa7 /swaynag/main.c
parentf51b9478f28143a4f1887711497ff131f26ab1c4 (diff)
parente86d99acd655815781cd2e23877ce58ab5b24826 (diff)
Merge branch 'master' into commands
Diffstat (limited to 'swaynag/main.c')
-rw-r--r--swaynag/main.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/swaynag/main.c b/swaynag/main.c
index 6b0b5236..d1a0d236 100644
--- a/swaynag/main.c
+++ b/swaynag/main.c
@@ -34,9 +34,10 @@ int main(int argc, char **argv) {
button_close->type = SWAYNAG_ACTION_DISMISS;
list_add(swaynag.buttons, button_close);
- swaynag.details.button_details.text = strdup("Toggle Details");
- swaynag.details.button_details.type = SWAYNAG_ACTION_EXPAND;
-
+ swaynag.details.button_details =
+ calloc(sizeof(struct swaynag_button), 1);
+ swaynag.details.button_details->text = strdup("Toggle Details");
+ swaynag.details.button_details->type = SWAYNAG_ACTION_EXPAND;
char *config_path = NULL;
bool debug = false;
@@ -99,9 +100,10 @@ int main(int argc, char **argv) {
swaynag_types_free(types);
if (swaynag.details.message) {
- list_add(swaynag.buttons, &swaynag.details.button_details);
+ list_add(swaynag.buttons, swaynag.details.button_details);
} else {
- free(swaynag.details.button_details.text);
+ free(swaynag.details.button_details->text);
+ free(swaynag.details.button_details);
}
wlr_log(WLR_DEBUG, "Output: %s", swaynag.type->output);
@@ -123,7 +125,8 @@ int main(int argc, char **argv) {
cleanup:
swaynag_types_free(types);
- free(swaynag.details.button_details.text);
+ free(swaynag.details.button_details->text);
+ free(swaynag.details.button_details);
swaynag_destroy(&swaynag);
return exit_code;
}