Skip to content

Commit ab9571b

Browse files
committed
die() consistency: always add newline
1 parent 56a31dc commit ab9571b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

drw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
129129
return NULL;
130130
}
131131
} else {
132-
die("no font specified.\n");
132+
die("no font specified.");
133133
}
134134

135135
font = ecalloc(1, sizeof(Fnt));
@@ -188,7 +188,7 @@ drw_clr_create(Drw *drw, XftColor *dest, const char *clrname)
188188
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
189189
DefaultColormap(drw->dpy, drw->screen),
190190
clrname, dest))
191-
die("error, cannot allocate color '%s'\n", clrname);
191+
die("error, cannot allocate color '%s'", clrname);
192192
}
193193

194194
/* Wrapper to create color schemes. The caller has to call free(3) on the
@@ -331,7 +331,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
331331

332332
if (!drw->fonts->pattern) {
333333
/* Refer to the comment in xfont_create for more information. */
334-
die("the first font in the cache must be loaded from a font string.\n");
334+
die("the first font in the cache must be loaded from a font string.");
335335
}
336336

337337
fcpattern = FcPatternDuplicate(drw->fonts->pattern);

dwm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ setup(void)
15611561
root = RootWindow(dpy, screen);
15621562
drw = drw_create(dpy, screen, root, sw, sh);
15631563
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
1564-
die("no fonts could be loaded.\n");
1564+
die("no fonts could be loaded.");
15651565
lrpad = drw->fonts->h;
15661566
bh = drw->fonts->h + 2;
15671567
updategeom();
@@ -2101,7 +2101,7 @@ xerrordummy(Display *dpy, XErrorEvent *ee)
21012101
int
21022102
xerrorstart(Display *dpy, XErrorEvent *ee)
21032103
{
2104-
die("dwm: another window manager is already running\n");
2104+
die("dwm: another window manager is already running");
21052105
return -1;
21062106
}
21072107

@@ -2123,13 +2123,13 @@ int
21232123
main(int argc, char *argv[])
21242124
{
21252125
if (argc == 2 && !strcmp("-v", argv[1]))
2126-
die("dwm-"VERSION "\n");
2126+
die("dwm-"VERSION);
21272127
else if (argc != 1)
2128-
die("usage: dwm [-v]\n");
2128+
die("usage: dwm [-v]");
21292129
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
21302130
fputs("warning: no locale support\n", stderr);
21312131
if (!(dpy = XOpenDisplay(NULL)))
2132-
die("dwm: cannot open display\n");
2132+
die("dwm: cannot open display");
21332133
checkotherwm();
21342134
setup();
21352135
scan();

util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ die(const char *fmt, ...) {
2727
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
2828
fputc(' ', stderr);
2929
perror(NULL);
30+
} else {
31+
fputc('\n', stderr);
3032
}
3133

3234
exit(1);

0 commit comments

Comments
 (0)