From a8799ed2f7bb3e9a1ff19079326460990980da4d Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sat, 5 Mar 2022 09:32:22 -0500 Subject: [PATCH] add extra null checsk and remove assert from utilCStrMatch() --- include/util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/util.h b/include/util.h index 00a94a3..e431c2c 100644 --- a/include/util.h +++ b/include/util.h @@ -182,12 +182,13 @@ utilSafeFree(void* p) bool utilCStrMatch(const char* str1, const char* str2) { - assert(str1 != nullptr && str2 != nullptr); + if (!str1 || !str2) + return false; + u32 l1 = strlen(str1); u32 l2 = strlen(str2); - return (l1 == l2) - && (strncmp(str1, str2, l1) == 0); + return (l1 == l2 && strncmp(str1, str2, l1) == 0); } #endif