diff options
| author | Juanma Barranquero | 2003-04-27 11:22:16 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-04-27 11:22:16 +0000 |
| commit | ee435bae30d77414dd7c2b0d69fa1309030430e9 (patch) | |
| tree | 665b6cc32af4de814e8260977aa2edf2ec385136 /lib-src | |
| parent | 9d7ab3f0ee327299fd64587c13ba34ee2bf541dc (diff) | |
| download | emacs-ee435bae30d77414dd7c2b0d69fa1309030430e9.tar.gz emacs-ee435bae30d77414dd7c2b0d69fa1309030430e9.zip | |
(read_scores): Fix corruption of score files.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/update-game-score.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
| 357 | scorecount++; | 357 | scorecount++; |
| 358 | if (scorecount >= cursize) | 358 | if (scorecount >= cursize) |
| 359 | { | 359 | { |
| 360 | ret = (struct score_entry *) realloc (ret, cursize *= 2); | 360 | cursize *= 2; |
| 361 | ret = (struct score_entry *) | ||
| 362 | realloc (ret, (sizeof (struct score_entry) * cursize)); | ||
| 361 | if (!ret) | 363 | if (!ret) |
| 362 | return -1; | 364 | return -1; |
| 363 | } | 365 | } |