changeset 2745:1c5f33811ad6 draft

(svn r3290) - Fix: "[ 1360054 ] Rename Sign, Cause Game Crash, nightly version r3213": Added filter to test for valid character input.
author peter1138 <peter1138@openttd.org>
date Tue, 13 Dec 2005 07:32:06 +0000
parents d000233daf8a
children 042cdca86cef
files macros.h
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/macros.h
+++ b/macros.h
@@ -167,7 +167,11 @@
 /* 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 */