Fix use of strncmp

This commit is contained in:
Sergeanur
2020-12-25 15:18:48 +02:00
parent dc72729a40
commit e00b8a93bf
10 changed files with 80 additions and 66 deletions

View File

@@ -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++) {