diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-13 13:54:38 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-13 13:54:38 +0100 |
commit | d9dc4907574b52afc7b5181e9813fd36da2ca201 (patch) | |
tree | c61c8cac02d052ef1a4c4f6b7f028ea7b5c13d79 /src/z-term.c | |
parent | a2819d22e68ba4557ffcbfc31b32df11454f8c07 (diff) |
Inline safe_calloc() and remove z-virt.c
Diffstat (limited to 'src/z-term.c')
-rw-r--r-- | src/z-term.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/z-term.c b/src/z-term.c index cb429e17..7d1d5964 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -14,7 +14,6 @@ #include "z-term.h" -#include "z-virt.h" /* @@ -245,6 +244,19 @@ term *Term = NULL; /* + * Calloc wrapper which aborts if NULL is returned by calloc + */ +static void *safe_calloc(size_t nmemb, size_t size) +{ + void *p = calloc(nmemb, size); + if ((nmemb > 0) && (p == NULL)) + { + abort(); + } + return p; +} + +/* * Nuke a term_win (see below) */ static errr term_win_nuke(term_win *s, int w, int h) |