diff options
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 12 |
1 files changed, 2 insertions, 10 deletions
| @@ -9,14 +9,6 @@ | |||
| 9 | #include <sys/wait.h> | 9 | #include <sys/wait.h> |
| 10 | #include <unistd.h> | 10 | #include <unistd.h> |
| 11 | 11 | ||
| 12 | /* static */ | ||
| 13 | |||
| 14 | static void | ||
| 15 | badmalloc(unsigned int size) | ||
| 16 | { | ||
| 17 | eprint("fatal: could not malloc() %u bytes\n", size); | ||
| 18 | } | ||
| 19 | |||
| 20 | /* extern */ | 12 | /* extern */ |
| 21 | 13 | ||
| 22 | void * | 14 | void * |
| @@ -25,7 +17,7 @@ emallocz(unsigned int size) | |||
| 25 | void *res = calloc(1, size); | 17 | void *res = calloc(1, size); |
| 26 | 18 | ||
| 27 | if(!res) | 19 | if(!res) |
| 28 | badmalloc(size); | 20 | eprint("fatal: could not malloc() %u bytes\n", size); |
| 29 | return res; | 21 | return res; |
| 30 | } | 22 | } |
| 31 | 23 | ||
| @@ -45,7 +37,7 @@ erealloc(void *ptr, unsigned int size) | |||
| 45 | { | 37 | { |
| 46 | void *res = realloc(ptr, size); | 38 | void *res = realloc(ptr, size); |
| 47 | if(!res) | 39 | if(!res) |
| 48 | badmalloc(size); | 40 | eprint("fatal: could not malloc() %u bytes\n", size); |
| 49 | return res; | 41 | return res; |
| 50 | } | 42 | } |
| 51 | 43 | ||
