diff --git a/object.c b/object.c index 5466ac3..07a5af5 100644 --- a/object.c +++ b/object.c @@ -46,6 +46,7 @@ int Object_attack(void *self, int damage) void *Object_new(size_t size, Object proto, char *description) { + assert(description != NULL); // setup the default functions in case they aren't set if(!proto.init) proto.init = Object_init; if(!proto.describe) proto.describe = Object_describe; @@ -56,6 +57,7 @@ void *Object_new(size_t size, Object proto, char *description) // this seems weird, but we can make a struct of one size, // then point a different pointer at it to "cast" it Object *el = calloc(size, 1); + assert(el != NULL); *el = proto; // copy the description over