From fa639dfce7d77d6c9712c42532150682ea79c625 Mon Sep 17 00:00:00 2001 From: Dan Staples Date: Tue, 11 Oct 2022 11:57:20 -0400 Subject: [PATCH] Fix implementation of stricmp --- loader/clib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loader/clib.c b/loader/clib.c index af49ff5..b8c4182 100644 --- a/loader/clib.c +++ b/loader/clib.c @@ -101,10 +101,8 @@ int _strcmp(const char *str1, const char *str2) { int stricmp(const char *str1, const char *str2) { while (*str1 && *str2) { - if ((*str1 | 0x20) != (*str2 | 0x20)) { - return 0; - } + if ((*str1 | 0x20) != (*str2 | 0x20)) break; str1++; str2++; } - return *str2 == 0; + return (int)*str1 - (int)*str2; }