removed badmalloc (thx for the pointer to Uriel)
6a3ae5e2
1 file(s) · +2 −10
| 9 | 9 | #include <sys/wait.h> |
|
| 10 | 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 | 12 | /* extern */ |
|
| 21 | 13 | ||
| 22 | 14 | void * |
|
| 25 | 17 | void *res = calloc(1, size); |
|
| 26 | 18 | ||
| 27 | 19 | if(!res) |
|
| 28 | - | badmalloc(size); |
|
| 20 | + | eprint("fatal: could not malloc() %u bytes\n", size); |
|
| 29 | 21 | return res; |
|
| 30 | 22 | } |
|
| 31 | 23 | ||
| 45 | 37 | { |
|
| 46 | 38 | void *res = realloc(ptr, size); |
|
| 47 | 39 | if(!res) |
|
| 48 | - | badmalloc(size); |
|
| 40 | + | eprint("fatal: could not malloc() %u bytes\n", size); |
|
| 49 | 41 | return res; |
|
| 50 | 42 | } |
|
| 51 | 43 | ||