From b9c4d85bb0f89de70414e81643ab352a3a542d16 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 10 May 2024 22:23:47 +0200 Subject: [PATCH] String equality check --- src/driver/string.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/driver/string.hpp b/src/driver/string.hpp index d4a3d0d..27aeb3f 100644 --- a/src/driver/string.hpp +++ b/src/driver/string.hpp @@ -17,4 +17,22 @@ namespace string RtlStringCchPrintfA(buffer, VA_BUFFER_SIZE, message, std::forward(args)...); return buffer; } + + inline bool equal(const char* s1, const char* s2) + { + if (!s1) + { + return !s2; + } + + while (*s1) + { + if (*(s1++) != *(s2++)) + { + return false; + } + } + + return !*s2; + } }