From 922321b2511f09734afbfd18ba87b3d3badf6577 Mon Sep 17 00:00:00 2001 From: copperwater Date: Thu, 30 Jul 2020 23:07:30 -0400 Subject: [PATCH] Add instructions to zero mextra struct pointer in mextra documentation It doesn't mention anywhere that newmextra() is responsible for initializing struct mextra with null pointers to the various sub-structs. So, when one follows the instructions and doesn't know or remember to do this, they'll get segfaults when something tries to read the uninitialized pointer to their new struct. --- include/mextra.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mextra.h b/include/mextra.h index 9ceee2fb2..ca42f2bb7 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -56,6 +56,8 @@ * struct or data during a restore. * 10. Adjust savemon() in src/save.c to deal with your * struct or data during a save. + * 11. Zero out the pointer to your struct in newmextra() in + * src/makemon.c. */ /***