From 59bddde594a9bca91de4f09914c092c37efe6200 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 10 Jun 2010 23:12:20 +0400 Subject: [PATCH] msvcrt: Add _snprintf_s implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/wcs.c | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 2117c052d68..e6524d6a06e 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1044,7 +1044,7 @@ @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ stub _snprintf_s +@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s @ stub _snprintf_s_l @ stub _snscanf @ stub _snscanf_l diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 0249277d32c..db65318aa41 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -891,7 +891,7 @@ @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ stub _snprintf_s +@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s @ stub _snprintf_s_l @ stub _snscanf @ stub _snscanf_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 6592e7cd732..1da6e823729 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -877,7 +877,7 @@ @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ stub _snprintf_s +@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s @ stub _snprintf_s_l @ stub _snscanf @ stub _snscanf_l diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 604a5ce37eb..ff195193626 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -830,7 +830,7 @@ # stub _snprintf_c # stub _snprintf_c_l # stub _snprintf_l -# stub _snprintf_s +@ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s # stub _snprintf_s_l # stub _snscanf # stub _snscanf_l diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 78e42b2566f..9571928c19f 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1102,6 +1102,20 @@ int CDECL MSVCRT__snprintf(char *str, unsigned int len, const char *format, ...) return retval; } +/********************************************************************* + * _snprintf_s (MSVCRT.@) + */ +int CDECL MSVCRT__snprintf_s(char *str, unsigned int len, unsigned int count, + const char *format, ...) +{ + int retval; + __ms_va_list valist; + __ms_va_start(valist, format); + retval = MSVCRT_vsnprintf_s_l(str, len, count, format, NULL, valist); + __ms_va_end(valist); + return retval; +} + /********************************************************************* * vsnwprintf_internal (INTERNAL) */