Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8c334ee
)
removed badmalloc (thx for the pointer to Uriel)
author
Anselm R. Garbe <
[email protected]
>
Tue, 22 Aug 2006 14:06:11 +0000
(16:06 +0200)
committer
Anselm R. Garbe <
[email protected]
>
Tue, 22 Aug 2006 14:06:11 +0000
(16:06 +0200)
util.c
patch
|
blob
|
history
diff --git
a/util.c
b/util.c
index
99d7beb
..
2eb9eb2
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-9,14
+9,6
@@
#include <sys/wait.h>
#include <unistd.h>
#include <sys/wait.h>
#include <unistd.h>
-/* static */
-
-static void
-badmalloc(unsigned int size)
-{
- eprint("fatal: could not malloc() %u bytes\n", size);
-}
-
/* extern */
void *
/* extern */
void *
@@
-25,7
+17,7
@@
emallocz(unsigned int size)
void *res = calloc(1, size);
if(!res)
void *res = calloc(1, size);
if(!res)
-
badmalloc(
size);
+
eprint("fatal: could not malloc() %u bytes\n",
size);
return res;
}
return res;
}
@@
-45,7
+37,7
@@
erealloc(void *ptr, unsigned int size)
{
void *res = realloc(ptr, size);
if(!res)
{
void *res = realloc(ptr, size);
if(!res)
-
badmalloc(
size);
+
eprint("fatal: could not malloc() %u bytes\n",
size);
return res;
}
return res;
}