diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-12-25 15:18:48 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-12-25 15:18:48 +0200 |
commit | e00b8a93bf7a53ef09bc349aefd3a2a37d58f09e (patch) | |
tree | 924da3fee9f1013e15de1ffa6a7f72e9537e46e1 /src/core/General.h | |
parent | dc72729a40b7710ce734cdd76c34b7c91c5f714a (diff) |
Fix use of strncmp
Diffstat (limited to 'src/core/General.h')
-rw-r--r-- | src/core/General.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/General.h b/src/core/General.h index 7e06b96e..69492fb8 100644 --- a/src/core/General.h +++ b/src/core/General.h @@ -123,6 +123,15 @@ public: return *str2 != '\0'; } + static bool faststrncmp(const char *str1, const char *str2, uint32 count) + { + for(uint32 i = 0; *str1 && i < count; str1++, str2++, i++) { + if (*str1 != *str2) + return true; + } + return false; + } + static bool faststricmp(const char *str1, const char *str2) { for (; *str1; str1++, str2++) { |