Krolyxon
Commit 8cc5cee

Branches

Refs →

nsxiv8cc5cee

fix -Wwrite-strings related warnings

Author
NRK
Date
2021-12-27 14:32 +0600
Committer
N-R-K · 2022-01-06 17:53 +0000
Parent
80ada33
Commit
8cc5cee08f74f0681739b48c11611043009a6d5a

+6 −4

1 file changed

  1. M window.c +6 −4
M window.c View
@@ -186,6 +186,8 @@ void win_open(win_t *win)
186186 pid_t pid;
187187 char hostname[256];
188188 XSetWindowAttributes attrs;
189+ char res_class[] = RES_CLASS;
190+ char res_name[] = "nsxiv";
189191
190192 e = &win->env;
191193 parent = options->embed ? options->embed : RootWindow(e->dpy, e->scr);
@@ -284,11 +286,11 @@ void win_open(win_t *win)
284286 free(icon_data);
285287
286288 /* These two atoms won't change and thus only need to be set once. */
287− XStoreName(win->env.dpy, win->xwin, "nsxiv");
288− XSetIconName(win->env.dpy, win->xwin, "nsxiv");
289+ XStoreName(win->env.dpy, win->xwin, res_name);
290+ XSetIconName(win->env.dpy, win->xwin, res_name);
289291
290− classhint.res_class = RES_CLASS;
291− classhint.res_name = options->res_name != NULL ? options->res_name : "nsxiv";
292+ classhint.res_class = res_class;
293+ classhint.res_name = options->res_name != NULL ? options->res_name : res_name;
292294 XSetClassHint(e->dpy, win->xwin, &classhint);
293295
294296 XSetWMProtocols(e->dpy, win->xwin, &atoms[ATOM_WM_DELETE_WINDOW], 1);