commit 8315a680be35167b4bbc09da84a262fb3c868c0f
parent b510b6061ccb713ed37c2d2c179d8732c357db3a
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sun, 18 Apr 2021 05:17:34 -0700
Remove trailing newlines from error messages
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lel.c b/lel.c
@@ -235,7 +235,9 @@ ximage(unsigned int newwidth, unsigned int newheight)
ximg = NULL;
}
depth = DefaultDepth(dpy, screen);
- if (depth >= 24) {
+ if (depth < 24) {
+ die("this program does not yet support display depths < 24\n");
+ } else {
if (xpix)
XFreePixmap(dpy, xpix);
xpix = XCreatePixmap(dpy, win, winwidth, winheight, depth);
@@ -244,8 +246,6 @@ ximage(unsigned int newwidth, unsigned int newheight)
ximg->data = malloc(ximg->bytes_per_line * ximg->height);
scale(ximg->width, ximg->height, ximg->bytes_per_line, ximg->data);
XInitImage(ximg);
- } else {
- die("this program does not yet support display depths < 24\n");
}
}
@@ -480,7 +480,7 @@ setup(void)
XClassHint class = { getprogname(), getprogname() };
if (!(dpy = XOpenDisplay(NULL)))
- die("can't open X display\n");
+ die("unable to open X display");
xfd = ConnectionNumber(dpy);
screen = DefaultScreen(dpy);
@@ -490,7 +490,7 @@ setup(void)
gc = XCreateGC(dpy, win, 0, NULL);
cmap = DefaultColormap(dpy, screen);
if (!XAllocNamedColor(dpy, cmap, bgcolor, &bg, &bg))
- die("cannot allocate color\n");
+ die("unable to allocate color");
XStoreName(dpy, win, imgs[img.index]);
XSelectInput(dpy, win, StructureNotifyMask | ExposureMask | KeyPressMask |
ButtonPressMask);