# HG changeset patch # User Juanma Barranquero # Date 1051442536 0 # Node ID 240f333f936cc666c8291d00664e8116bc9b2eac # Parent 318f8d4ecf5aa9d6b138f30fa748bd0a0ddc045a (read_scores): Fix corruption of score files. diff -r 318f8d4ecf5a -r 240f333f936c lib-src/update-game-score.c --- a/lib-src/update-game-score.c Sun Apr 27 11:09:53 2003 +0000 +++ b/lib-src/update-game-score.c Sun Apr 27 11:22:16 2003 +0000 @@ -357,7 +357,9 @@ 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; }