aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/General.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-12-25 15:18:13 +0200
committerSergeanur <s.anureev@yandex.ua>2020-12-25 15:18:13 +0200
commitb12eef1d56575206538abed426a296fefe22e90e (patch)
treea029f5ec513ec487d477d791e21f90ae1287965a /src/core/General.h
parent687ff4bdbb422bfb6364b25df91203b98481e6fa (diff)
Fix use of strncmp
Diffstat (limited to 'src/core/General.h')
-rw-r--r--src/core/General.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/General.h b/src/core/General.h
index dde43c0f..de803558 100644
--- a/src/core/General.h
+++ b/src/core/General.h
@@ -121,6 +121,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++) {