mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[D3D9][ARPING] Add missing va_start() and va_end() (#371)
This commit is contained in:
parent
d1265b932c
commit
cd4db318d0
2 changed files with 6 additions and 5 deletions
|
@ -48,6 +48,7 @@ HRESULT SafeFormatString(OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR Format
|
|||
|
||||
va_start(vargs, FormatString);
|
||||
BytesWritten = _vsnprintf(Buffer, BufferSize-1, FormatString, vargs);
|
||||
va_end(vargs);
|
||||
|
||||
if (BytesWritten < BufferSize)
|
||||
return DDERR_GENERIC;
|
||||
|
|
|
@ -59,26 +59,26 @@ void FormatOutput(UINT uID, ...)
|
|||
}
|
||||
|
||||
va_start(valist, uID);
|
||||
|
||||
DataLength = FormatMessage(FORMAT_MESSAGE_FROM_STRING, Format, 0, 0, Buf,\
|
||||
sizeof(Buf) / sizeof(WCHAR), &valist);
|
||||
sizeof(Buf) / sizeof(WCHAR), &valist);
|
||||
va_end(valist);
|
||||
|
||||
if(!DataLength)
|
||||
{
|
||||
if(GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
va_end(valist);
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(valist, uID);
|
||||
DataLength = FormatMessage(FORMAT_MESSAGE_FROM_STRING |\
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER,\
|
||||
Format, 0, 0, (LPWSTR)&pBuf, 0, &valist);
|
||||
Format, 0, 0, (LPWSTR)&pBuf, 0, &valist);
|
||||
va_end(valist);
|
||||
}
|
||||
|
||||
if(!DataLength)
|
||||
{
|
||||
va_end(valist);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue