X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3-nagbar%2Fmain.c;h=d86cd69a3f984f15f80012117b868d168f06ef3b;hb=fdfe4081593268257cd65932bd5353eade45e190;hp=eacdca19a6d640169398ea624d83e3c5dd5ce8fd;hpb=3191be366d0f7d034e66f13019b4c7ea65b34f8d;p=i3%2Fi3 diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index eacdca19..d86cd69a 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -2,7 +2,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * i3-nagbar is a utility which displays a nag message, for example in the case * when the user has an error in their configuration file. @@ -300,8 +300,8 @@ static xcb_rectangle_t get_window_position(void) { xcb_randr_get_screen_resources_current_cookie_t rcookie = xcb_randr_get_screen_resources_current(conn, root); xcb_randr_get_output_primary_cookie_t pcookie = xcb_randr_get_output_primary(conn, root); - xcb_randr_get_output_primary_reply_t *primary; - xcb_randr_get_screen_resources_current_reply_t *res; + xcb_randr_get_output_primary_reply_t *primary = NULL; + xcb_randr_get_screen_resources_current_reply_t *res = NULL; if ((primary = xcb_randr_get_output_primary_reply(conn, pcookie, NULL)) == NULL) { DLOG("Could not determine the primary output.\n"); @@ -326,7 +326,7 @@ static xcb_rectangle_t get_window_position(void) { if (crtc == NULL) goto free_resources; - DLOG("Found primary output on position x = %i / y = %i / w = %i / h = %i", + DLOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n", crtc->x, crtc->y, crtc->width, crtc->height); if (crtc->width == 0 || crtc->height == 0) { DLOG("Primary output is not active, ignoring it.\n"); @@ -371,7 +371,7 @@ int main(int argc, char *argv[]) { if (argv0_len > strlen(".nagbar_cmd") && strcmp(argv[0] + argv0_len - strlen(".nagbar_cmd"), ".nagbar_cmd") == 0) { unlink(argv[0]); - cmd = strdup(argv[0]); + cmd = sstrdup(argv[0]); *(cmd + argv0_len - strlen(".nagbar_cmd")) = '\0'; execl("/bin/sh", "/bin/sh", cmd, NULL); err(EXIT_FAILURE, "execv(/bin/sh, /bin/sh, %s)", cmd); @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) { printf("i3-nagbar [-m ] [-b