From e25b8236e4ccab365633e64ad5a9eb6a58dd3491 Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Wed, 28 May 2025 20:21:24 +0200 Subject: [PATCH] switch from assert to if + return --- strops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/strops.c b/strops.c index 81e7248..83f0394 100644 --- a/strops.c +++ b/strops.c @@ -132,7 +132,9 @@ bool_t strops_equals(const char* string1, const char* string2) { } bool_t strops_starts_with(const char* string1, const char* string2) { - assert(strops_length(string1) >= strops_length(string2) && "string2 cannot be longer than string1"); + if (strops_length(string1) < strops_length(string2)) { + return 0; + } bool_t starts_with = 1; ull_t i; for (i = 0; i < strops_length(string2); i++) {