From 5e00c669c6b148850c48454c1960ed13eb700382 Mon Sep 17 00:00:00 2001 From: Eric-Paul Ickhorn Date: Thu, 14 Dec 2023 22:03:32 +0100 Subject: [PATCH] Fixed a bug with the two string equals functions --- core/src-c/strutil.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src-c/strutil.c b/core/src-c/strutil.c index 06be599..57d694b 100644 --- a/core/src-c/strutil.c +++ b/core/src-c/strutil.c @@ -12,7 +12,10 @@ bool_t rr_strings_equal(const char *string1, const char *string2) { usz_t index = 0; while(string1[index] == string2[index]) + { if(string1[index] == ZERO) return TRUE; + ++index; + } return FALSE; } @@ -23,6 +26,7 @@ bool_t rr_strings_equal_up_to(const char *string1, const char *string2, usz_t ma { if(string1[index] == ZERO) return TRUE; if(index >= max_length) return TRUE; + ++index; } return FALSE; }