From 6ea704fe5b581c3cd0854ab1b3c1e53b2e578731 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 20 Apr 2024 13:01:33 -0400 Subject: [PATCH] Add an assertion to Person_print --- lcthw/ex16.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lcthw/ex16.c b/lcthw/ex16.c index 2e0e590..639e441 100644 --- a/lcthw/ex16.c +++ b/lcthw/ex16.c @@ -33,6 +33,8 @@ void Person_destroy(struct Person *who) void Person_print(struct Person *who) { + assert(who != NULL); + printf("Name: %s\n", who->name); printf("\tAge: %d\n", who->age); printf("\tHeight: %d\n", who->height);