From ee435bae30d77414dd7c2b0d69fa1309030430e9 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 27 Apr 2003 11:22:16 +0000 Subject: [PATCH] (read_scores): Fix corruption of score files. --- lib-src/update-game-score.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 55737c542d7..2a699b2550d 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -357,7 +357,9 @@ read_scores (filename, scores, count) scorecount++; if (scorecount >= cursize) { - ret = (struct score_entry *) realloc (ret, cursize *= 2); + cursize *= 2; + ret = (struct score_entry *) + realloc (ret, (sizeof (struct score_entry) * cursize)); if (!ret) return -1; } -- 2.11.4.GIT