summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-07-31 22:11:34 +0000
committerDarkvater <Darkvater@openttd.org>2006-07-31 22:11:34 +0000
commit01f11b997022d2b6e1937b480f0c231a1bcdb2c4 (patch)
tree324b4fc0d30866882b6415c8accf29bf57ca9be6 /string.c
parentcc88f3591fbf0812ae71325393b139f0f2213e89 (diff)
downloadopenttd-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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/string.c b/string.c
index 18428527d..c4d3e8371 100644
--- a/string.c
+++ b/string.c
@@ -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);
+}