https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cd4db318d0a205be9b76d…
commit cd4db318d0a205be9b76d40431b82a588cd72428
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Fri Feb 16 10:28:25 2018 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Feb 16 10:28:25 2018 +0100
[D3D9][ARPING] Add missing va_start() and va_end() (#371)
---
dll/directx/d3d9/d3d9_helpers.c | 1 +
modules/rosapps/applications/cmdutils/arping/arping.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dll/directx/d3d9/d3d9_helpers.c b/dll/directx/d3d9/d3d9_helpers.c
index 6231f4031c..2747eab96d 100644
--- a/dll/directx/d3d9/d3d9_helpers.c
+++ b/dll/directx/d3d9/d3d9_helpers.c
@@ -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;
diff --git a/modules/rosapps/applications/cmdutils/arping/arping.c
b/modules/rosapps/applications/cmdutils/arping/arping.c
index 461abbf5c3..8836f52352 100644
--- a/modules/rosapps/applications/cmdutils/arping/arping.c
+++ b/modules/rosapps/applications/cmdutils/arping/arping.c
@@ -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;
}