Piotr Caban : msvcrt: Don't use strncmpW in msvcrt_get_flags.

Alexandre Julliard julliard at winehq.org
Tue Jul 14 16:23:39 CDT 2020


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jul 14 20:23:14 2020 +0200

msvcrt: Don't use strncmpW in msvcrt_get_flags.

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

---

 dlls/msvcrt/file.c   | 2 +-
 dlls/msvcrt/msvcrt.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 6b7471a56a..868a752575 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -1611,7 +1611,7 @@ static int msvcrt_get_flags(const MSVCRT_wchar_t* mode, int *open_flags, int* st
 
     mode++;
     while(*mode == ' ') mode++;
-    if(!MSVCRT_CHECK_PMT(!strncmpW(ccs, mode, ARRAY_SIZE(ccs))))
+    if(!MSVCRT_CHECK_PMT(!MSVCRT_wcsncmp(ccs, mode, ARRAY_SIZE(ccs))))
       return -1;
     mode += ARRAY_SIZE(ccs);
     while(*mode == ' ') mode++;
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index dc89c6af23..c4263ccc16 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -1196,6 +1196,7 @@ unsigned int __cdecl MSVCRT__get_output_format(void);
 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
 char* __cdecl MSVCRT__itoa(int, char*, int);
 double parse_double(MSVCRT_wchar_t (*)(void*), void (*)(void*), void*, MSVCRT_pthreadlocinfo, int*);
+int __cdecl MSVCRT_wcsncmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t);
 
 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
  *      #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)




More information about the wine-cvs mailing list