diff options
author | rubidium <rubidium@openttd.org> | 2009-02-21 00:47:59 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-21 00:47:59 +0000 |
commit | 057ceec51c0080826d9c3f2e1cf914d307f734a8 (patch) | |
tree | 596de78887a2230e9424cf8c05d7d5933819c4fa | |
parent | 85ea21a5d018f1a403b1e91f88c3b1b83694d533 (diff) | |
download | openttd-057ceec51c0080826d9c3f2e1cf914d307f734a8.tar.xz |
(svn r15537) -Fix (r5215): don't allow special sprite characters (e.g. the ship sprite) as characters in input like filenames or text that is sent over the network.
-rw-r--r-- | src/string.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/string.cpp b/src/string.cpp index 1ab68a274..f01786a97 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -104,8 +104,7 @@ void str_validate(char *str, bool allow_newlines, bool ignore) size_t len; for (len = Utf8Decode(&c, str); c != '\0'; len = Utf8Decode(&c, str)) { - if (IsPrintable(c) && (c < SCC_SPRITE_START || c > SCC_SPRITE_END || - IsValidChar(c - SCC_SPRITE_START, CS_ALPHANUMERAL))) { + if (IsPrintable(c) && (c < SCC_SPRITE_START || c > SCC_SPRITE_END)) { /* Copy the character back. Even if dst is current the same as str * (i.e. no characters have been changed) this is quicker than * moving the pointers ahead by len */ |