(SCT_MAXDEF): Make it equal the maximum sector type, not the maximum

plus one.  Users changed.  This indirectly fixes off-by-one loop
bounds in budg(), show_sect_build(), show_sect_stats() and
show_sect_capab().  The show bugs were harmless: the loops ran into
the sentinel, which they ignore.  The budg bug was serious: the loop
ran into the entries for SCT_EFFIC.  This lead to a bogus line in the
budget, printing of a null pointer, and doubled sector build cost.
Budget priorities masked this bug until rev. 1.25.
This commit is contained in:
Markus Armbruster 2006-06-22 17:10:26 +00:00
parent f9588063ff
commit 2d99971a7f
4 changed files with 6 additions and 6 deletions

View file

@ -44,7 +44,7 @@
* Table of sector designations
* Initialized on startup from sect.config and deity custom config (if any).
*/
struct dchrstr dchr[SCT_MAXDEF + 1];
struct dchrstr dchr[SCT_MAXDEF + 2];
/*
* Table of infrastructure types