Alexandre Julliard : msvcrt: Use the msvcrt string functions internally.

Alexandre Julliard julliard at winehq.org
Wed Nov 18 15:48:01 CST 2020


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Nov 18 16:04:34 2020 +0100

msvcrt: Use the msvcrt string functions internally.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/math.c   | 4 ++--
 dlls/msvcrt/mbcs.c   | 4 ++--
 dlls/msvcrt/msvcrt.h | 4 ++++
 dlls/msvcrt/time.c   | 6 +++---
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index e68c16d7a57..e5b0e67c4be 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -2455,7 +2455,7 @@ char * CDECL MSVCRT__ecvt( double number, int ndigits, int *decpt, int *sign )
     /* take the exponential "e" out */
     data->efcvt_buffer[ prec] = '\0';
     /* read the exponent */
-    sscanf( data->efcvt_buffer + prec + 1, "%d", decpt);
+    MSVCRT_sscanf( data->efcvt_buffer + prec + 1, "%d", decpt);
     (*decpt)++;
     /* adjust for some border cases */
     if( data->efcvt_buffer[0] == '0')/* value is zero */
@@ -2515,7 +2515,7 @@ int CDECL MSVCRT__ecvt_s( char *buffer, MSVCRT_size_t length, double number, int
     /* take the exponential "e" out */
     result[ prec] = '\0';
     /* read the exponent */
-    sscanf( result + prec + 1, "%d", decpt);
+    MSVCRT_sscanf( result + prec + 1, "%d", decpt);
     (*decpt)++;
     /* adjust for some border cases */
     if( result[0] == '0')/* value is zero */
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index 13fffc5734a..dae3cb5cee2 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -124,7 +124,7 @@ static inline MSVCRT_size_t u_strlen( const unsigned char *str )
 
 static inline unsigned char* u_strncat( unsigned char* dst, const unsigned char* src, MSVCRT_size_t len )
 {
-  return (unsigned char*)strncat( (char*)dst, (const char*)src, len);
+  return (unsigned char*)MSVCRT_strncat( (char*)dst, (const char*)src, len);
 }
 
 static inline int u_strcmp( const unsigned char *s1, const unsigned char *s2 )
@@ -154,7 +154,7 @@ static inline unsigned char *u_strchr( const unsigned char *s, unsigned char x )
 
 static inline unsigned char *u_strrchr( const unsigned char *s, unsigned char x )
 {
-  return (unsigned char*) strrchr( (const char*)s, x );
+  return (unsigned char*) MSVCRT_strrchr( (const char*)s, x );
 }
 
 static inline unsigned char *u__strset( unsigned char *s, unsigned char c )
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 7c9e3137e14..229d8a07a9b 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -1170,6 +1170,7 @@ int __cdecl      _ungetch(int);
 int __cdecl      _cputs(const char*);
 int WINAPIV      _cprintf(const char*,...);
 int WINAPIV      _cwprintf(const MSVCRT_wchar_t*,...);
+int WINAPIV      MSVCRT_sscanf(const char *, const char *, ...);
 char*** __cdecl  MSVCRT___p__environ(void);
 int*    __cdecl  __p___mb_cur_max(void);
 int*    __cdecl  MSVCRT___p__fmode(void);
@@ -1200,9 +1201,12 @@ int __cdecl      MSVCRT__stricmp(const char*, const char*);
 int __cdecl      MSVCRT__strnicmp(const char*, const char*, MSVCRT_size_t);
 int __cdecl      MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
 int __cdecl      MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
+char* __cdecl    MSVCRT_strncat(char*,const char *,MSVCRT_size_t);
 int __cdecl      MSVCRT_strncmp(const char*, const char*, MSVCRT_size_t);
 int __cdecl      MSVCRT_strcmp(const char*, const char*);
+char* __cdecl    MSVCRT_strrchr(const char *, int);
 char* __cdecl    MSVCRT_strstr(const char*, const char*);
+MSVCRT_long __cdecl MSVCRT_strtol(const char*, char**, int);
 unsigned int __cdecl MSVCRT__get_output_format(void);
 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
 char* __cdecl MSVCRT__itoa(int, char*, int);
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c
index b71f5ac1224..702aaa8166f 100644
--- a/dlls/msvcrt/time.c
+++ b/dlls/msvcrt/time.c
@@ -127,11 +127,11 @@ void CDECL MSVCRT__tzset(void)
         }else if(*tz == '+') {
             tz++;
         }
-        MSVCRT___timezone = strtol(tz, &tz, 10)*3600;
+        MSVCRT___timezone = MSVCRT_strtol(tz, &tz, 10)*3600;
         if(*tz == ':') {
-            MSVCRT___timezone += strtol(tz+1, &tz, 10)*60;
+            MSVCRT___timezone += MSVCRT_strtol(tz+1, &tz, 10)*60;
             if(*tz == ':')
-                MSVCRT___timezone += strtol(tz+1, &tz, 10);
+                MSVCRT___timezone += MSVCRT_strtol(tz+1, &tz, 10);
         }
         if(neg_zone)
             MSVCRT___timezone = -MSVCRT___timezone;




More information about the wine-cvs mailing list