mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r3290) - Fix: "[ 1360054 ] Rename Sign, Cause Game Crash, nightly version r3213": Added filter to test for valid character input.
This commit is contained in:
parent
17aab1797b
commit
ea2d440827
6
macros.h
6
macros.h
@ -167,7 +167,11 @@ static inline void swap_tile(TileIndex *a, TileIndex *b) { TileIndex t = *a; *a
|
||||
/* IS_INT_INSIDE = filter for ascii-function codes like BELL and so on [we need an special filter here later] */
|
||||
static inline bool IsValidAsciiChar(byte key)
|
||||
{
|
||||
return IS_INT_INSIDE(key, ' ', 256);
|
||||
// XXX This filter stops certain crashes, but may be too restrictive.
|
||||
return IS_INT_INSIDE(key, ' ', 127) ||
|
||||
(IS_INT_INSIDE(key, 160, 256) &&
|
||||
key != 0xAA && key != 0xAC && key != 0xAD && key != 0xAF &&
|
||||
key != 0xB5 && key != 0xB6 && key != 0xB7 && key != 0xB9);
|
||||
}
|
||||
|
||||
#endif /* MACROS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user