diff options
author | rubidium <rubidium@openttd.org> | 2009-03-06 01:23:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-06 01:23:25 +0000 |
commit | 86ca408d469811d13a15d5c7a671feda38126eb0 (patch) | |
tree | 8972c2c7b9b1ab7c2b41b46cd9a44f1bb0fbd9bd /src/string_func.h | |
parent | c3a7e6b693716232fd2aefab3f36bd555620b563 (diff) | |
download | openttd-86ca408d469811d13a15d5c7a671feda38126eb0.tar.xz |
(svn r15626) -Fix [FS#2698]: UTF8 string handling could cause buffer overruns.
Diffstat (limited to 'src/string_func.h')
-rw-r--r-- | src/string_func.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/string_func.h b/src/string_func.h index ad32a5558..ae5903bf1 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -93,9 +93,15 @@ int CDECL seprintf(char *str, const char *last, const char *format, ...); char *CDECL str_fmt(const char *str, ...); -/** Scans the string for valid characters and if it finds invalid ones, - * replaces them with a question mark '?' */ -void str_validate(char *str, bool allow_newlines = false, bool ignore = false); +/** + * Scans the string for valid characters and if it finds invalid ones, + * replaces them with a question mark '?' (if not ignored) + * @param str the string to validate + * @param last the last valid character of str + * @param allow_newlines whether newlines should be allowed or ignored + * @param ignore whether to ignore or replace with a question mark + */ +void str_validate(char *str, const char *last, bool allow_newlines = false, bool ignore = false); /** Scans the string for colour codes and strips them */ void str_strip_colours(char *str); |