Skip to content

Commit 2073e7c

Browse files
committed
Fix small string compare issue
1 parent 3ddb751 commit 2073e7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Utility/Containers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2942,7 +2942,10 @@ class StackString {
29422942

29432943
bool operator==(StackString const& other) const
29442944
{
2945-
return !std::strncmp(data_.data(), other.data_.data(), std::min(data_.size(), other.data_.size()));
2945+
if(data_.size() != other.data_.size())
2946+
return false;
2947+
2948+
return !std::strncmp(data_.data(), other.data_.data(), data_.size());
29462949
}
29472950

29482951
// Returns the number of characters in the string.

0 commit comments

Comments
 (0)