Jacek Caban : stdio.h: Add ucrt sprintf_s declaration.

Alexandre Julliard julliard at winehq.org
Fri Feb 21 15:27:06 CST 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Feb 21 16:41:15 2020 +0100

stdio.h: Add ucrt sprintf_s declaration.

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

---

 include/msvcrt/stdio.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
index 76bf70d81b..42799223d9 100644
--- a/include/msvcrt/stdio.h
+++ b/include/msvcrt/stdio.h
@@ -140,7 +140,6 @@ int    WINAPIV scanf(const char*,...);
 int    WINAPIV scanf_s(const char*,...);
 void   __cdecl setbuf(FILE*,char*);
 int    __cdecl setvbuf(FILE*,char*,int,size_t);
-int    WINAPIV sprintf_s(char*,size_t,const char*,...);
 int    WINAPIV sscanf(const char*,const char*,...);
 int    WINAPIV sscanf_s(const char*,const char*,...);
 int    WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...);
@@ -222,6 +221,17 @@ static inline int __cdecl vsprintf_s(char *buffer, const char *format, __ms_va_l
     return ret < 0 ? -1 : ret;
 }
 
+static inline int WINAPIV sprintf_s(char *buffer, size_t size, size_t count, const char *format, ...)
+{
+    int ret;
+    __ms_va_list args;
+
+    __ms_va_start(args, format);
+    ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, -1, format, NULL, args);
+    __ms_va_end(args);
+    return ret;
+}
+
 static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, __ms_va_list args)
 {
     int ret = __stdio_common_vsprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
@@ -303,6 +313,7 @@ _ACRTIMP int WINAPIV fprintf(FILE*,const char*,...);
 _ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...);
 _ACRTIMP int WINAPIV printf(const char*,...);
 _ACRTIMP int WINAPIV printf_s(const char*,...);
+_ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...);
 _ACRTIMP int __cdecl vfprintf(FILE*,const char*,__ms_va_list);
 _ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,__ms_va_list);
 _ACRTIMP int __cdecl vprintf(const char*,__ms_va_list);




More information about the wine-cvs mailing list