removed emalloc, used only once so obsolete 2cef0ddb
Anselm R Garbe · 2008-06-21 16:43 1 file(s) · +2 −11
dmenu.c +2 −11
52 52
static void cleanup(void);
53 53
static void drawmenu(void);
54 54
static void drawtext(const char *text, ulong col[ColLast]);
55 -
static void *emalloc(uint size);
56 55
static void eprint(const char *errstr, ...);
57 56
static ulong getcolor(const char *colstr);
58 57
static Bool grabkeyboard(void);
250 249
		XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
251 250
	else
252 251
		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
253 -
}
254 -
255 -
void *
256 -
emalloc(uint size) {
257 -
	void *res = malloc(size);
258 -
259 -
	if(!res)
260 -
		eprint("fatal: could not malloc() %u bytes\n", size);
261 -
	return res;
262 252
}
263 253
264 254
void
563 553
			maxname = p;
564 554
			max = len;
565 555
		}
566 -
		new = emalloc(sizeof(Item));
556 +
		if((new = (Item *)malloc(sizeof(Item))) == NULL)
557 +
			eprint("fatal: could not malloc() %u bytes\n", sizeof(Item));
567 558
		new->next = new->left = new->right = NULL;
568 559
		new->text = p;
569 560
		if(!i)