Piotr Caban : msvcrt: Copy memcmp implementation from ntdll.

Alexandre Julliard julliard at winehq.org
Wed Jul 22 16:34:28 CDT 2020


Module: wine
Branch: master
Commit: 773f0a835bf26b97416763720c8a0f1b2ded8094
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=773f0a835bf26b97416763720c8a0f1b2ded8094

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Jul 22 11:10:22 2020 +0200

msvcrt: Copy memcmp implementation from ntdll.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/string.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 3a71dc97b0..fe2cf6abe5 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -2219,7 +2219,14 @@ int CDECL MSVCRT_I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I1
  */
 int __cdecl MSVCRT_memcmp(const void *ptr1, const void *ptr2, MSVCRT_size_t n)
 {
-    return memcmp(ptr1, ptr2, n);
+    const unsigned char *p1, *p2;
+
+    for (p1 = ptr1, p2 = ptr2; n; n--, p1++, p2++)
+    {
+        if (*p1 < *p2) return -1;
+        if (*p1 > *p2) return 1;
+    }
+    return 0;
 }
 
 /*********************************************************************




More information about the wine-cvs mailing list