From b4507b3601bedcaa599673b9f9083d1574132157 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 2 Nov 2024 20:57:37 +0100 Subject: more fixes --- backend/String.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backend/String.cpp') diff --git a/backend/String.cpp b/backend/String.cpp index 84dc2ec..8be6892 100644 --- a/backend/String.cpp +++ b/backend/String.cpp @@ -95,7 +95,9 @@ bool String::empty() const { bool operator == (const String & a, const String & b) { - return strncmp(a._data, b._data, min(a._data_len, b._data_len)) == 0; + if (a._data_len != b._data_len) return false; + if (a._data_len == 0) return true; + return strncmp(a._data, b._data, a._data_len) == 0; } bool operator != (const String & a, const String & b) { -- cgit v1.2.3