Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
fix typo
[dmenu.git]
/
draw.c
diff --git
a/draw.c
b/draw.c
index
80a5074
..
d35d4c2
100644
(file)
--- a/
draw.c
+++ b/
draw.c
@@
-7,9
+7,9
@@
#include <X11/Xlib.h>
#include "draw.h"
#include <X11/Xlib.h>
#include "draw.h"
-#define MAX(a, b)
((a) > (b) ? (a) : (b))
-#define MIN(a, b)
((a) < (b) ? (a) : (b))
-#define DEFFONT
"fixed"
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define DEFFONT "fixed"
static Bool loadfont(DC *dc, const char *fontstr);
static Bool loadfont(DC *dc, const char *fontstr);
@@
-68,6
+68,11
@@
eprintf(const char *fmt, ...) {
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
+
+ if(fmt[strlen(fmt)-1] == ':') {
+ fputc(' ', stderr);
+ perror(NULL);
+ }
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
@@
-101,7
+106,7
@@
initdc(void) {
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
weprintf("no locale support\n");
if(!(dc = calloc(1, sizeof *dc)))
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
weprintf("no locale support\n");
if(!(dc = calloc(1, sizeof *dc)))
- eprintf("cannot malloc %u bytes
\n
", sizeof *dc);
+ eprintf("cannot malloc %u bytes
:
", sizeof *dc);
if(!(dc->dpy = XOpenDisplay(NULL)))
eprintf("cannot open display\n");
if(!(dc->dpy = XOpenDisplay(NULL)))
eprintf("cannot open display\n");