diff options
author | rubidium <rubidium@openttd.org> | 2010-11-10 17:49:14 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-10 17:49:14 +0000 |
commit | 17b514ccd191f8aa57a1464c4223c3a3f5034ad9 (patch) | |
tree | 9250caa0dc994e0293ff9516fb1fb6d742f488f4 /src/string_func.h | |
parent | 8cd48767f93deb6ac4ef084574971e8f74a21038 (diff) | |
download | openttd-17b514ccd191f8aa57a1464c4223c3a3f5034ad9.tar.xz |
(svn r21133) -Add: function to check the validity of a string (without modifying it)
Diffstat (limited to 'src/string_func.h')
-rw-r--r-- | src/string_func.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string_func.h b/src/string_func.h index b2e88f52b..802b62e50 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -118,6 +118,15 @@ void str_strip_colours(char *str); void strtolower(char *str); /** + * Checks whether the given string is valid, i.e. contains only + * valid (printable) characters and is properly terminated. + * @param str The string to validate. + * @param last The last character of the string, i.e. the string + * must be terminated here or earlier. + */ +bool StrValid(const char *str, const char *last); + +/** * Check if a string buffer is empty. * * @param s The pointer to the firste element of the buffer |