removed emallocz
0a9ef560
1 file(s) · +2 −11
| 132 | 132 | void drawbar(void); |
|
| 133 | 133 | void drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]); |
|
| 134 | 134 | void drawtext(const char *text, ulong col[ColLast], Bool invert); |
|
| 135 | - | void *emallocz(uint size); |
|
| 136 | 135 | void enternotify(XEvent *e); |
|
| 137 | 136 | void eprint(const char *errstr, ...); |
|
| 138 | 137 | void expose(XEvent *e); |
|
| 596 | 595 | XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); |
|
| 597 | 596 | } |
|
| 598 | 597 | ||
| 599 | - | void * |
|
| 600 | - | emallocz(uint size) { |
|
| 601 | - | void *res = calloc(1, size); |
|
| 602 | - | ||
| 603 | - | if(!res) |
|
| 604 | - | eprint("fatal: could not malloc() %u bytes\n", size); |
|
| 605 | - | return res; |
|
| 606 | - | } |
|
| 607 | - | ||
| 608 | 598 | void |
|
| 609 | 599 | enternotify(XEvent *e) { |
|
| 610 | 600 | Client *c; |
|
| 931 | 921 | Window trans; |
|
| 932 | 922 | XWindowChanges wc; |
|
| 933 | 923 | ||
| 934 | - | c = emallocz(sizeof(Client)); |
|
| 924 | + | if(!(c = calloc(1, sizeof(Client)))) |
|
| 925 | + | eprint("fatal: could not calloc() %u bytes\n", sizeof(Client)); |
|
| 935 | 926 | c->win = w; |
|
| 936 | 927 | ||
| 937 | 928 | /* geometry */ |
|