Use MAPWIDTH() to allocate map buffers

sona(), radmap2() and satmap() used WORLD_X + 1, which equals
MAPWIDTH(1).  Using MAPWIDTH() is somewhat clearer and cleaner.
This commit is contained in:
Markus Armbruster 2008-08-31 09:26:50 -04:00
parent d012940230
commit 7803cd9dd1
3 changed files with 5 additions and 5 deletions

View file

@ -73,9 +73,9 @@ sona(void)
if (!snxtitem(&ni, EF_SHIP, player->argp[1], NULL))
return RET_SYN;
if (!radbuf)
radbuf = malloc((WORLD_Y * (WORLD_X + 1)));
radbuf = malloc(WORLD_Y * MAPWIDTH(1));
if (!visbuf)
visbuf = malloc((WORLD_Y * (WORLD_X + 1)));
visbuf = malloc(WORLD_Y * MAPWIDTH(1));
if (!rad && radbuf) {
rad = malloc(WORLD_Y * sizeof(char *));
if (rad) {