die() consistency: always add newline
026827fd
3 file(s) · +9 −7
| 187 | 187 | return; |
|
| 188 | 188 | nanosleep(&ts, NULL); |
|
| 189 | 189 | } |
|
| 190 | - | die("cannot grab keyboard\n"); |
|
| 190 | + | die("cannot grab keyboard"); |
|
| 191 | 191 | } |
|
| 192 | 192 | ||
| 193 | 193 | static void |
|
| 205 | 205 | /* separate input text into tokens to be matched individually */ |
|
| 206 | 206 | for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " ")) |
|
| 207 | 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 | 209 | len = tokc ? strlen(tokv[0]) : 0; |
|
| 210 | 210 | ||
| 211 | 211 | matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; |
|
| 647 | 647 | if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) |
|
| 648 | 648 | fputs("warning: no locale support\n", stderr); |
|
| 649 | 649 | if (!(dpy = XOpenDisplay(NULL))) |
|
| 650 | - | die("cannot open display\n"); |
|
| 650 | + | die("cannot open display"); |
|
| 651 | 651 | screen = DefaultScreen(dpy); |
|
| 652 | 652 | root = RootWindow(dpy, screen); |
|
| 653 | 653 | sw = DisplayWidth(dpy, screen); |
|
| 654 | 654 | sh = DisplayHeight(dpy, screen); |
|
| 655 | 655 | drw = drw_create(dpy, screen, root, sw, sh); |
|
| 656 | 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 | 658 | lrpad = drw->fonts->h; |
|
| 659 | 659 | ||
| 660 | 660 | if (fast) { |
|
| 129 | 129 | return NULL; |
|
| 130 | 130 | } |
|
| 131 | 131 | } else { |
|
| 132 | - | die("no font specified.\n"); |
|
| 132 | + | die("no font specified."); |
|
| 133 | 133 | } |
|
| 134 | 134 | ||
| 135 | 135 | font = ecalloc(1, sizeof(Fnt)); |
|
| 188 | 188 | if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), |
|
| 189 | 189 | DefaultColormap(drw->dpy, drw->screen), |
|
| 190 | 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 | 194 | /* Wrapper to create color schemes. The caller has to call free(3) on the |
|
| 331 | 331 | ||
| 332 | 332 | if (!drw->fonts->pattern) { |
|
| 333 | 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 | 337 | fcpattern = FcPatternDuplicate(drw->fonts->pattern); |
|
| 27 | 27 | if (fmt[0] && fmt[strlen(fmt)-1] == ':') { |
|
| 28 | 28 | fputc(' ', stderr); |
|
| 29 | 29 | perror(NULL); |
|
| 30 | + | } else { |
|
| 31 | + | fputc('\n', stderr); |
|
| 30 | 32 | } |
|
| 31 | 33 | ||
| 32 | 34 | exit(1); |