diff options
-rw-r--r-- | src/util/StringCompare.cxx | 4 | ||||
-rw-r--r-- | src/util/WStringCompare.cxx | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/util/StringCompare.cxx b/src/util/StringCompare.cxx index a7e505d12..fbd8e1d6d 100644 --- a/src/util/StringCompare.cxx +++ b/src/util/StringCompare.cxx @@ -36,8 +36,8 @@ bool StringStartsWith(const char *haystack, const char *needle) { - const size_t length = strlen(needle); - return memcmp(haystack, needle, length) == 0; + const size_t length = StringLength(needle); + return StringIsEqual(haystack, needle, length); } bool diff --git a/src/util/WStringCompare.cxx b/src/util/WStringCompare.cxx index 77c3a8629..723f7e47b 100644 --- a/src/util/WStringCompare.cxx +++ b/src/util/WStringCompare.cxx @@ -26,7 +26,8 @@ bool StringStartsWith(const wchar_t *haystack, const wchar_t *needle) { - return memcmp(haystack, needle, StringLength(needle) * sizeof(needle[0])) == 0; + const size_t length = StringLength(needle); + return StringIsEqual(haystack, needle, length); } bool |