Improved xgetrootname

This commit is contained in:
Ashish Kumar Yadav 2020-12-05 03:24:41 +05:30
parent 37557a90bd
commit 28f57528b1

View file

@ -4,8 +4,8 @@
int
main()
{
Display *dpy;
char *name;
Display *dpy;
if (!(dpy = XOpenDisplay(NULL))) {
fputs("Error: could not open display.\n", stderr);
@ -14,7 +14,7 @@ main()
if (XFetchName(dpy, DefaultRootWindow(dpy), &name) && name[0])
printf("%s\n", name);
else
puts("No name has been set for the root window.");
fputs("No name has been set for the root window.\n", stderr);
XFree(name);
XCloseDisplay(dpy);
return 0;