diff options
author | 2015-12-13 11:23:55 +0100 | |
---|---|---|
committer | 2015-12-13 11:23:55 +0100 | |
commit | 4e580a77b9da9b78aba1fec8e44b1de5a4a14aaf (patch) | |
tree | df0e1d28daa79b9151088498a933cd1fc37c9c07 /src/lib/util/corestr.cpp | |
parent | 1cda42b22e591965ee69561fcf52272bd991b3b2 (diff) | |
parent | 14d5966a379e9783ba724750a5f84a72af62cadc (diff) |
Merge pull request #9 from mamedev/master
Sync to base master
Diffstat (limited to 'src/lib/util/corestr.cpp')
-rw-r--r-- | src/lib/util/corestr.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp index b4a75a3bc48..336d788cabb 100644 --- a/src/lib/util/corestr.cpp +++ b/src/lib/util/corestr.cpp @@ -114,11 +114,11 @@ int core_strwildcmp(const char *sp1, const char *sp2) char *core_strdup(const char *str) { - char *cpy = NULL; - if (str != NULL) + char *cpy = nullptr; + if (str != nullptr) { cpy = (char *)osd_malloc_array(strlen(str) + 1); - if (cpy != NULL) + if (cpy != nullptr) strcpy(cpy, str); } return cpy; @@ -261,18 +261,18 @@ void strdelchr(std::string& str, char chr) void strreplacechr(std::string& str, char ch, char newch) { - for (size_t i = 0; i < str.length(); i++) + for (auto & elem : str) { - if (str[i] == ch) str[i] = newch; + if (elem == ch) elem = newch; } } std::string strtrimspace(std::string& str) { int start = 0; - for (size_t i = 0; i < str.length(); i++) + for (auto & elem : str) { - if (!isspace(UINT8(str[i]))) break; + if (!isspace(UINT8(elem))) break; start++; } int end = str.length(); |