Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
50717:318f8d4ecf5a | 50718:240f333f936c |
---|---|
355 if (readval < 0) | 355 if (readval < 0) |
356 return -1; | 356 return -1; |
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 } |
364 } | 366 } |
365 *count = scorecount; | 367 *count = scorecount; |