diff --git a/src/common/kernel/ship.c b/src/common/kernel/ship.c index 521e349f8..bd9b67d29 100644 --- a/src/common/kernel/ship.c +++ b/src/common/kernel/ship.c @@ -425,7 +425,7 @@ tagbegin(struct xml_stack * stack) if (tname!=NULL) { if (st->coast) { terrain_t * tnew; - for (;st->coast[size++]!=NOTERRAIN;); + for (;st->coast[size]!=NOTERRAIN;++size); tnew = malloc(sizeof(terrain_t) * (size+2)); memcpy(tnew, st->coast, size*sizeof(terrain_t)); free(st->coast);