file: Provide EF_WITH_CADEF_MAX_ENTRY_SIZE to clean up xditem()
xditem() needs a buffer that can hold entries of any xdumpable table. It's been 2048 bytes and marked FIXME since day one. Clean it up so that if anyone ever goes crazy with entry sizes, we fail an assertion during startup instead of overrunning the buffer during play. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
9ef4f1bf50
commit
9a6998882a
3 changed files with 16 additions and 4 deletions
|
@ -27,7 +27,7 @@
|
|||
* file.h: Describes Empire tables (`files' for historical reasons)
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2005-2012
|
||||
* Markus Armbruster, 2005-2014
|
||||
*/
|
||||
|
||||
#ifndef FILE_H
|
||||
|
@ -130,6 +130,12 @@ struct emptypedstr {
|
|||
/* Create table file, clobbering any existing file */
|
||||
#define EFF_CREATE bit(16)
|
||||
|
||||
/*
|
||||
* A value larger than any struct empfile member size where member
|
||||
* cadef is not null.
|
||||
*/
|
||||
#define EF_WITH_CADEF_MAX_ENTRY_SIZE 1024
|
||||
|
||||
/*
|
||||
* Empire `file types'
|
||||
* These are really table IDs. Some tables are backed by files, some
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue