Add memory allocation checks

Closes #18.
This commit is contained in:
Marc Tiehuis
2017-08-12 11:09:07 +12:00
parent 912afdfe05
commit 984a5b9f18
4 changed files with 14 additions and 3 deletions
+2 -2
View File
@@ -216,10 +216,10 @@ static int digits_ceiling(unsigned int n)
struct gamestate* gamestate_init(int argc, char **argv)
{
struct gameoptions *opt = gameoptions_default();
if (argc != 0) parse_options(opt, argc, argv);
if (!opt) return NULL;
if (argc != 0) parse_options(opt, argc, argv);
srand(time(NULL));
struct gamestate *g = malloc(sizeof(struct gamestate));