Mercurial > emacs
diff lib-src/update-game-score.c @ 50718:240f333f936c
(read_scores): Fix corruption of score files.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 27 Apr 2003 11:22:16 +0000 |
parents | 23a1cea22d13 |
children | f20c52ac1b8d |
line wrap: on
line diff
--- 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; }