mextra follow up bit 2

<Someone> noticed the leftover zeromextra, this removes it.

Using memset() on a possibly failed mextra allocation was inapprorpriate,
so replace the newmextra() macro with a function.

Prevent a crash in christen_monst() if mextra was not initialized.
This commit is contained in:
nethack.allison
2006-01-06 22:16:46 +00:00
parent 30c508a664
commit aea3c50163
4 changed files with 12 additions and 5 deletions
-4
View File
@@ -110,10 +110,6 @@ struct mextra {
struct edog *edog;
};
#define newmextra() \
(struct mextra *) memset((genericptr_t)alloc(sizeof(struct mextra)), \
0, sizeof(struct mextra))
#define MNAME(mon) ((mon)->mextra->mname)
#define EGD(mon) ((mon)->mextra->egd)
#define EPRI(mon) ((mon)->mextra->epri)