summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-29 23:02:31 +0000
committerrubidium <rubidium@openttd.org>2007-10-29 23:02:31 +0000
commitb14c94867a121a5c6b9b69340953368aee8a8876 (patch)
treef4608f438da95909157f41aa78f5a878e7152382 /src/fileio.cpp
parent24956ab71ba1dd9ed1734ae262229f098662b275 (diff)
downloadopenttd-b14c94867a121a5c6b9b69340953368aee8a8876.tar.xz
(svn r11355) -Fix [FS#1377]: loading too many GRFs was not handled gracefully causing crashes and such.
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 5a917d086..f33c8e0c1 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -24,19 +24,18 @@
/*************************************************/
#define FIO_BUFFER_SIZE 512
-#define MAX_HANDLES 64
struct Fio {
- byte *buffer, *buffer_end; ///< position pointer in local buffer and last valid byte of buffer
- uint32 pos; ///< current (system) position in file
- FILE *cur_fh; ///< current file handle
- const char *filename; ///< current filename
- FILE *handles[MAX_HANDLES]; ///< array of file handles we can have open
- byte buffer_start[FIO_BUFFER_SIZE]; ///< local buffer when read from file
- const char *filenames[MAX_HANDLES]; ///< array of filenames we (should) have open
+ byte *buffer, *buffer_end; ///< position pointer in local buffer and last valid byte of buffer
+ uint32 pos; ///< current (system) position in file
+ FILE *cur_fh; ///< current file handle
+ const char *filename; ///< current filename
+ FILE *handles[MAX_FILE_SLOTS]; ///< array of file handles we can have open
+ byte buffer_start[FIO_BUFFER_SIZE]; ///< local buffer when read from file
+ const char *filenames[MAX_FILE_SLOTS]; ///< array of filenames we (should) have open
#if defined(LIMITED_FDS)
- uint open_handles; ///< current amount of open handles
- uint usage_count[MAX_HANDLES]; ///< count how many times this file has been opened
+ uint open_handles; ///< current amount of open handles
+ uint usage_count[MAX_FILE_SLOTS]; ///< count how many times this file has been opened
#endif /* LIMITED_FDS */
};