Browse Source

removed emalloc, used only once so obsolete

master
Anselm R Garbe 16 years ago
parent
commit
2cef0ddb01
1 changed files with 2 additions and 11 deletions
  1. +2
    -11
      dmenu.c

+ 2
- 11
dmenu.c View File

@ -52,7 +52,6 @@ static char *cistrstr(const char *s, const char *sub);
static void cleanup(void); static void cleanup(void);
static void drawmenu(void); static void drawmenu(void);
static void drawtext(const char *text, ulong col[ColLast]); static void drawtext(const char *text, ulong col[ColLast]);
static void *emalloc(uint size);
static void eprint(const char *errstr, ...); static void eprint(const char *errstr, ...);
static ulong getcolor(const char *colstr); static ulong getcolor(const char *colstr);
static Bool grabkeyboard(void); static Bool grabkeyboard(void);
@ -252,15 +251,6 @@ drawtext(const char *text, ulong col[ColLast]) {
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
} }
void *
emalloc(uint size) {
void *res = malloc(size);
if(!res)
eprint("fatal: could not malloc() %u bytes\n", size);
return res;
}
void void
eprint(const char *errstr, ...) { eprint(const char *errstr, ...) {
va_list ap; va_list ap;
@ -563,7 +553,8 @@ readstdin(void) {
maxname = p; maxname = p;
max = len; max = len;
} }
new = emalloc(sizeof(Item));
if((new = (Item *)malloc(sizeof(Item))) == NULL)
eprint("fatal: could not malloc() %u bytes\n", sizeof(Item));
new->next = new->left = new->right = NULL; new->next = new->left = new->right = NULL;
new->text = p; new->text = p;
if(!i) if(!i)


Loading…
Cancel
Save