Xinqi Bao's Git
projects
/
dmenu.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3f244b1
)
removed emalloc, used only once so obsolete
author
Anselm R Garbe <
[email protected]
>
Sat, 21 Jun 2008 15:43:12 +0000
(16:43 +0100)
committer
Anselm R Garbe <
[email protected]
>
Sat, 21 Jun 2008 15:43:12 +0000
(16:43 +0100)
dmenu.c
patch
|
blob
|
history
diff --git
a/dmenu.c
b/dmenu.c
index
bf74edb
..
fa7bbe8
100644
(file)
--- a/
dmenu.c
+++ b/
dmenu.c
@@
-52,7
+52,6
@@
static char *cistrstr(const char *s, const char *sub);
static void cleanup(void);
static void drawmenu(void);
static void drawtext(const char *text, ulong col[ColLast]);
static void cleanup(void);
static void drawmenu(void);
static void drawtext(const char *text, ulong col[ColLast]);
-static void *emalloc(uint size);
static void eprint(const char *errstr, ...);
static ulong getcolor(const char *colstr);
static Bool grabkeyboard(void);
static void eprint(const char *errstr, ...);
static ulong getcolor(const char *colstr);
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
eprint(const char *errstr, ...) {
va_list ap;
void
eprint(const char *errstr, ...) {
va_list ap;
@@
-563,7
+553,8
@@
readstdin(void) {
maxname = p;
max = len;
}
maxname = p;
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->text = p;
if(!i)
new->next = new->left = new->right = NULL;
new->text = p;
if(!i)