aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gameproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/gameproc.c')
-rw-r--r--FICS/gameproc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/FICS/gameproc.c b/FICS/gameproc.c
index 0969e60..8dc82f6 100644
--- a/FICS/gameproc.c
+++ b/FICS/gameproc.c
@@ -631,12 +631,20 @@ process_move(int p, char *command)
if (!garray[g].moveList) {
garray[g].moveList =
- rmalloc(sizeof(move_t) *
+ reallocarray(NULL,
+ sizeof(move_t),
garray[g].moveListSize);
+ if (garray[g].moveList == NULL)
+ err(1, "%s: reallocarray", __func__);
+ else
+ malloc_count++;
} else {
garray[g].moveList =
- rrealloc(garray[g].moveList,
- (sizeof(move_t) * garray[g].moveListSize));
+ reallocarray(garray[g].moveList,
+ sizeof(move_t),
+ garray[g].moveListSize);
+ if (garray[g].moveList == NULL)
+ err(1, "%s: reallocarray", __func__);
}
}