aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-08-12 14:39:30 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-08-12 14:39:30 +0200
commit026827fd65c1163a92a984c4eae3882a6d69f8df (patch)
tree9de6cecba4d2eedd2a0de5284cbcd228dee4c919
parentd14670b9959f8b3760b63dd40a70687a90312b8a (diff)
die() consistency: always add newline
-rw-r--r--dmenu.c8
-rw-r--r--drw.c6
-rw-r--r--util.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/dmenu.c b/dmenu.c
index df51e76..3b05752 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -187,7 +187,7 @@ grabkeyboard(void)
187 return; 187 return;
188 nanosleep(&ts, NULL); 188 nanosleep(&ts, NULL);
189 } 189 }
190 die("cannot grab keyboard\n"); 190 die("cannot grab keyboard");
191} 191}
192 192
193static void 193static void
@@ -205,7 +205,7 @@ match(void)
205 /* separate input text into tokens to be matched individually */ 205 /* separate input text into tokens to be matched individually */
206 for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " ")) 206 for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " "))
207 if (++tokc > tokn && !(tokv = realloc(tokv, ++tokn * sizeof *tokv))) 207 if (++tokc > tokn && !(tokv = realloc(tokv, ++tokn * sizeof *tokv)))
208 die("cannot realloc %u bytes\n", tokn * sizeof *tokv); 208 die("cannot realloc %u bytes:", tokn * sizeof *tokv);
209 len = tokc ? strlen(tokv[0]) : 0; 209 len = tokc ? strlen(tokv[0]) : 0;
210 210
211 matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; 211 matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
@@ -647,14 +647,14 @@ main(int argc, char *argv[])
647 if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) 647 if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
648 fputs("warning: no locale support\n", stderr); 648 fputs("warning: no locale support\n", stderr);
649 if (!(dpy = XOpenDisplay(NULL))) 649 if (!(dpy = XOpenDisplay(NULL)))
650 die("cannot open display\n"); 650 die("cannot open display");
651 screen = DefaultScreen(dpy); 651 screen = DefaultScreen(dpy);
652 root = RootWindow(dpy, screen); 652 root = RootWindow(dpy, screen);
653 sw = DisplayWidth(dpy, screen); 653 sw = DisplayWidth(dpy, screen);
654 sh = DisplayHeight(dpy, screen); 654 sh = DisplayHeight(dpy, screen);
655 drw = drw_create(dpy, screen, root, sw, sh); 655 drw = drw_create(dpy, screen, root, sw, sh);
656 if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 656 if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
657 die("no fonts could be loaded.\n"); 657 die("no fonts could be loaded.");
658 lrpad = drw->fonts->h; 658 lrpad = drw->fonts->h;
659 659
660 if (fast) { 660 if (fast) {
diff --git a/drw.c b/drw.c
index 95839c9..c1582e7 100644
--- a/drw.c
+++ b/drw.c
@@ -129,7 +129,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
129 return NULL; 129 return NULL;
130 } 130 }
131 } else { 131 } else {
132 die("no font specified.\n"); 132 die("no font specified.");
133 } 133 }
134 134
135 font = ecalloc(1, sizeof(Fnt)); 135 font = ecalloc(1, sizeof(Fnt));
@@ -188,7 +188,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
188 if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), 188 if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
189 DefaultColormap(drw->dpy, drw->screen), 189 DefaultColormap(drw->dpy, drw->screen),
190 clrname, dest)) 190 clrname, dest))
191 die("error, cannot allocate color '%s'\n", clrname); 191 die("error, cannot allocate color '%s'", clrname);
192} 192}
193 193
194/* Wrapper to create color schemes. The caller has to call free(3) on the 194/* 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
331 331
332 if (!drw->fonts->pattern) { 332 if (!drw->fonts->pattern) {
333 /* Refer to the comment in xfont_create for more information. */ 333 /* 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.");
335 } 335 }
336 336
337 fcpattern = FcPatternDuplicate(drw->fonts->pattern); 337 fcpattern = FcPatternDuplicate(drw->fonts->pattern);
diff --git a/util.c b/util.c
index 6b703e9..b0612af 100644
--- a/util.c
+++ b/util.c
@@ -27,6 +27,8 @@ die(const char *fmt, ...) {
27 if (fmt[0] && fmt[strlen(fmt)-1] == ':') { 27 if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
28 fputc(' ', stderr); 28 fputc(' ', stderr);
29 perror(NULL); 29 perror(NULL);
30 } else {
31 fputc('\n', stderr);
30 } 32 }
31 33
32 exit(1); 34 exit(1);