diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index 70ded8d8..4d4e253a 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -41,7 +41,7 @@ static xcb_pixmap_t pixmap; static xcb_gcontext_t pixmap_gc; static xcb_rectangle_t rect = { 0, 0, 600, 20 }; static i3Font font; -static char *prompt = "Please do not run this program."; +static char *prompt; static button_t *buttons; static int buttoncnt; @@ -220,7 +220,7 @@ static int handle_expose(xcb_connection_t *conn, xcb_expose_event_t *event) { } int main(int argc, char *argv[]) { - char *pattern = "-misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1"; + char *pattern = strdup("-misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1"); int o, option_index = 0; enum { TYPE_ERROR = 0, TYPE_WARNING = 1 } bar_type = TYPE_ERROR; @@ -236,6 +236,8 @@ int main(int argc, char *argv[]) { char *options_string = "b:f:m:t:vh"; + prompt = strdup("Please do not run this program."); + while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) { switch (o) { case 'v': @@ -246,6 +248,7 @@ int main(int argc, char *argv[]) { pattern = strdup(optarg); break; case 'm': + FREE(prompt); prompt = strdup(optarg); break; case 't':