Use _vsnwprintf instead of vswprintf_s

This commit is contained in:
akallabeth 2022-02-28 11:32:08 +01:00 committed by akallabeth
parent 921f279fa9
commit 121e736694

View File

@ -562,8 +562,8 @@ static BOOL wf_gw_authenticate(freerdp* instance, char** username, char** passwo
static WCHAR* wf_format_text(const WCHAR* fmt, ...) static WCHAR* wf_format_text(const WCHAR* fmt, ...)
{ {
int rc; int rc;
size_t size = 1024; size_t size = 0;
WCHAR* buffer = calloc(size, sizeof(WCHAR)); WCHAR* buffer = NULL;
if (!buffer) if (!buffer)
return NULL; return NULL;
@ -572,7 +572,7 @@ static WCHAR* wf_format_text(const WCHAR* fmt, ...)
WCHAR* tmp; WCHAR* tmp;
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
rc = vswprintf_s(buffer, size, fmt, ap); rc = _vsnwprintf(buffer, size, fmt, ap);
va_end(ap); va_end(ap);
if (rc <= 0) if (rc <= 0)
goto fail; goto fail;