From f2030ca62da4fa3088104dd2d1b411b4b06c16a4 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Mon, 1 Feb 2021 17:42:16 -0800 Subject: [PATCH v2] include: Fix [v]sprintf_s declarations. Signed-off-by: Daniel Lehman --- v2: - pass size instead of -1 - same for vsprintf_s - change subject --- include/msvcrt/stdio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h index 7dd177e90528..f78e3b36f2bc 100644 --- a/include/msvcrt/stdio.h +++ b/include/msvcrt/stdio.h @@ -218,19 +218,19 @@ static inline int __cdecl vsprintf(char *buffer, const char *format, __ms_va_lis return ret < 0 ? -1 : ret; } -static inline int __cdecl vsprintf_s(char *buffer, const char *format, __ms_va_list args) +static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, __ms_va_list args) { - int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, -1, format, NULL, args); + int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args); return ret < 0 ? -1 : ret; } -static inline int WINAPIV sprintf_s(char *buffer, size_t size, size_t count, const char *format, ...) +static inline int WINAPIV sprintf_s(char *buffer, size_t size, 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); + ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args); __ms_va_end(args); return ret; } -- 2.27.0