summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-12-20 20:52:05 +0000
committerDarkvater <darkvater@openttd.org>2005-12-20 20:52:05 +0000
commit0f41b99c5e106e11708d0be478e7defb92f0a43a (patch)
treea8811c0d9f666534f8861378b0eb8b6629c5186b /macros.h
parent8f873d4ece827d8f95f8ded0f49b47dbe5942506 (diff)
downloadopenttd-0f41b99c5e106e11708d0be478e7defb92f0a43a.tar.xz
(svn r3322) - Fix: Network window crash when it receives invalid information for example from the integrated nightly, so validate the network-input when it is received
- CodeChange: added str_validate(char *str) function that checks if a string contains only printable characters and if not, replaces those characters by question marks. Also move IsValidAsciiChar() to string.h
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/macros.h b/macros.h
index 7d886fbe0..b9faad6b2 100644
--- a/macros.h
+++ b/macros.h
@@ -164,14 +164,4 @@ static inline void swap_tile(TileIndex *a, TileIndex *b) { TileIndex t = *a; *a
*/
#define ALIGN(x, n) (((x) + (n) - 1) & ~((n) - 1))
-/* 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)
-{
- // 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 */