From 4b1fecd44e8376594c418663351fcb30c4e841de Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 4 May 2015 21:54:46 +0200 Subject: Use libdraw: add Xft and fallback-fonts support to graphics lib - libdraw, util: add drw.{c,h}, util.{c,h} and update code. - libdraw: fix drw_rect(): use w and h parameter. - libdraw: print errstr if last character in string was ":" (sbase). - libdraw: drw_clr_free() allow valid free(NULL). - config.def.h: set default font to monospace. - cleanup() on exit. - LICENSE: update license string for dmenu -v to 2015. - LICENSE: add myself to LICENSE --- util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 util.c (limited to 'util.c') diff --git a/util.c b/util.c new file mode 100644 index 0000000..9b27512 --- /dev/null +++ b/util.c @@ -0,0 +1,23 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include +#include +#include + +#include "util.h" + +void +die(const char *fmt, ...) { + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + if (fmt[0] && fmt[strlen(fmt)-1] == ':') { + fputc(' ', stderr); + perror(NULL); + } + + exit(1); +} -- cgit v1.2.3