Merge pull request #7 from bvisness/right-side-sloppy

Fix overflow bug with MD_StringMatchFlag_RightSideSloppy
This commit is contained in:
Ryan Fleury
2022-02-17 14:17:17 -07:00
committed by GitHub
+1 -1
View File
@@ -962,7 +962,7 @@ MD_S8Match(MD_String8 a, MD_String8 b, MD_MatchFlags flags)
if(a.size == b.size || flags & MD_StringMatchFlag_RightSideSloppy)
{
result = 1;
for(MD_u64 i = 0; i < a.size; i += 1)
for(MD_u64 i = 0; i < a.size && i < b.size; i += 1)
{
MD_b32 match = (a.str[i] == b.str[i]);
if(flags & MD_StringMatchFlag_CaseInsensitive)