*
* 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.
*
* 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.
char *link_path;
char *exe_path = get_exe_path(argv0);
sasprintf(&link_path, "%s.nagbar_cmd", script_path);
char *link_path;
char *exe_path = get_exe_path(argv0);
sasprintf(&link_path, "%s.nagbar_cmd", script_path);
- symlink(exe_path, link_path);
+ if (symlink(exe_path, link_path) == -1) {
+ err(EXIT_FAILURE, "Failed to symlink %s to %s", link_path, exe_path);
+ }
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_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");
if ((primary = xcb_randr_get_output_primary_reply(conn, pcookie, NULL)) == NULL) {
DLOG("Could not determine the primary output.\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");
crtc->x, crtc->y, crtc->width, crtc->height);
if (crtc->width == 0 || crtc->height == 0) {
DLOG("Primary output is not active, ignoring it.\n");