diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-18 17:52:49 -0400 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-18 17:52:49 -0400 |
commit | 958bca606e80110e05d7c142dda3097fddc96503 (patch) | |
tree | 576917751444b4dfdb476d040b4e075bde431b7b /src/common/string_util.cpp | |
parent | 68a8594d041c416301feeb43bb9f1c41d681b795 (diff) | |
parent | 70c2cce963264678b5ba5b6aa17c2653bf459e61 (diff) |
Merge branch 'hle-interface'
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r-- | src/common/string_util.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index a99644f11..e5a9ba322 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -17,6 +17,22 @@ #include <errno.h> #endif +/// Make a string lowercase +void LowerStr(char* str) { + for (int i = 0; str[i]; i++) { + str[i] = tolower(str[ i ]); + } +} + +/// Make a string uppercase +void UpperStr(char* str) { + for (int i=0; i < strlen(str); i++) { + if(str[i] >= 'a' && str[i] <= 'z') { + str[i] &= 0xDF; + } + } +} + // faster than sscanf bool AsciiToHex(const char* _szValue, u32& result) { |