Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
applied something similiar to Jukkas patch
[dmenu.git]
/
util.c
diff --git
a/util.c
b/util.c
index
1b9bc57
..
d0444c5
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-13,25
+13,22
@@
/* static */
static void
/* static */
static void
-bad_malloc(unsigned int size)
-{
+badmalloc(unsigned int size) {
eprint("fatal: could not malloc() %u bytes\n", size);
}
/* extern */
void *
eprint("fatal: could not malloc() %u bytes\n", size);
}
/* extern */
void *
-emalloc(unsigned int size)
-{
+emalloc(unsigned int size) {
void *res = malloc(size);
if(!res)
void *res = malloc(size);
if(!res)
- bad
_
malloc(size);
+ badmalloc(size);
return res;
}
void
return res;
}
void
-eprint(const char *errstr, ...)
-{
+eprint(const char *errstr, ...) {
va_list ap;
va_start(ap, errstr);
va_list ap;
va_start(ap, errstr);
@@
-41,10
+38,9
@@
eprint(const char *errstr, ...)
}
char *
}
char *
-estrdup(const char *str)
-{
+estrdup(const char *str) {
void *res = strdup(str);
if(!res)
void *res = strdup(str);
if(!res)
- bad
_
malloc(strlen(str));
+ badmalloc(strlen(str));
return res;
}
return res;
}