From d453e614755f3cc289c88d3b63e62430525ba5a4 Mon Sep 17 00:00:00 2001 From: ip_gpu Date: Mon, 30 Oct 2017 09:47:32 +0500 Subject: [PATCH] fixed from PVS-Studio: V519 The 'dwSize' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 121, 132. proccoms.cpp 132 V576 Incorrect format. A different number of actual arguments is expected while calling 'fprintf' function. Expected: 4. Present: 3. remcom.cpp 1099, 1102 --- ProcComs/ProcComs.cpp | 2 -- RemCom.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ProcComs/ProcComs.cpp b/ProcComs/ProcComs.cpp index 6bd1ffd..2fbe615 100644 --- a/ProcComs/ProcComs.cpp +++ b/ProcComs/ProcComs.cpp @@ -129,8 +129,6 @@ void wmain(int argc, WCHAR *argv[]) if (!CreateEnvironmentBlock(&lpvEnv, hToken, TRUE)) ShowLastError(L"CreateEnvironmentBlock"); - dwSize = sizeof(szUserProfile)/sizeof(WCHAR); - if (!GetUserProfileDirectory(hToken, szUserProfile, &dwSize)) ShowLastError(L"GetUserProfileDirectory"); // // TO DO: change NULL to '.' to use local account database diff --git a/RemCom.cpp b/RemCom.cpp index 523f8e0..200cba4 100644 --- a/RemCom.cpp +++ b/RemCom.cpp @@ -1097,10 +1097,10 @@ BOOL ExecuteRemoteCommand() if ( response.dwErrorCode == 0 ) _ftprintf( stderr, _T("\nRemote command returned %d(0x%X)\n"), - response.dwReturnCode ); + response.dwReturnCode, response.dwReturnCode); else _ftprintf( stderr, _T("\nRemote command failed to start. Returned error code is %d(0x%X)\n"), - response.dwErrorCode ); + response.dwErrorCode, response.dwReturnCode); return response.dwErrorCode; }