diff options
author | Darkvater <Darkvater@openttd.org> | 2006-07-31 22:11:34 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-07-31 22:11:34 +0000 |
commit | 01f11b997022d2b6e1937b480f0c231a1bcdb2c4 (patch) | |
tree | 324b4fc0d30866882b6415c8accf29bf57ca9be6 /string.c | |
parent | cc88f3591fbf0812ae71325393b139f0f2213e89 (diff) | |
download | openttd-01f11b997022d2b6e1937b480f0c231a1bcdb2c4.tar.xz |
(svn r5684) - Codechange: create an strtolower() function that uses tolower() on a whole string and apply it in the places this was used.
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -4,6 +4,9 @@ #include "string.h" #include <stdarg.h> +#if defined(UNIX) || defined(__OS2__) +#include <ctype.h> // required for tolower() +#endif void ttd_strlcat(char *dst, const char *src, size_t size) { @@ -63,3 +66,8 @@ void str_validate(char *str) for (; *str != '\0'; str++) if (!IsValidAsciiChar(*str)) *str = '?'; } + +void strtolower(char *str) +{ + for (; *str != '\0'; str++) *str = tolower(*str); +} |