Skip to content

Commit

Permalink
Address Code Analysis Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreFood committed Jun 6, 2020
1 parent eb523de commit 4a7601a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ std::wstring GenerateInheritanceFlags(DWORD iCurrentFlags)
std::wstring GenerateAccessMask(DWORD iCurrentMask)
{
// define the aesthetic names of permission
static struct
static struct MaskDefinitionsType
{
const DWORD Mask;
const std::wstring Description;
Expand Down Expand Up @@ -471,7 +471,7 @@ std::wstring FileSizeToString(const LARGE_INTEGER iFileSize)
// convert the file size to a string
WCHAR sSize[32];
_wsetlocale(LC_NUMERIC, L"");
wsprintf(sSize, L"%I64u", iFileSize.QuadPart);
wsprintf(sSize, L"%I64u", (ULONGLONG) iFileSize.QuadPart);
return std::wstring(sSize);
}

Expand Down
4 changes: 2 additions & 2 deletions OperationLocate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ OperationLocate::OperationLocate(std::queue<std::wstring> & oArgList, const std:
std::vector<std::wstring> sMatchAndArgs = ProcessAndCheckArgs(1, oArgList, L"\\0");

// fetch params
HANDLE hFile = CreateFile(sReportFile[0].c_str(), GENERIC_WRITE,
HANDLE hFile = CreateFile(sReportFile.at(0).c_str(), GENERIC_WRITE,
FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);

// see if names could be resolved
if (hFile == INVALID_HANDLE_VALUE)
{
// complain
wprintf(L"ERROR: Could not create file '%s' specified for parameter '%s'.\n", sReportFile[0].c_str(), GetCommand().c_str());
wprintf(L"ERROR: Could not create file '%s' specified for parameter '%s'.\n", sReportFile.at(0).c_str(), GetCommand().c_str());
exit(-1);
}

Expand Down
2 changes: 1 addition & 1 deletion OperationLocateShortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ OperationLocateShortcut::OperationLocateShortcut(std::queue<std::wstring> & oArg
}
catch (const std::regex_error &)
{
wprintf(L"ERROR: Invalid regular expression '%s' specified for parameter '%s'.\n", sMatchAndArgs[0].c_str(), GetCommand().c_str());
wprintf(L"ERROR: Invalid regular expression '%s' specified for parameter '%s'.\n", sMatchAndArgs.at(0).c_str(), GetCommand().c_str());
exit(-1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion OperationPathList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ OperationPathList::OperationPathList(std::queue<std::wstring> & oArgList, const
}

// store off the argument
InputOutput::ScanPaths().push_back(oLineItems[0]);
InputOutput::ScanPaths().push_back(oLineItems.at(0));
}

// cleanup
Expand Down
2 changes: 1 addition & 1 deletion OperationReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ OperationReport::OperationReport(std::queue<std::wstring> & oArgList, const std:
AppliesToOwner = true;

// target certain parts of the security descriptor
if (sMatchAndArgs.size() > 1) ProcessGranularTargetting(sMatchAndArgs[1]);
if (sMatchAndArgs.size() > 1) ProcessGranularTargetting(sMatchAndArgs.at(1));
}

SidActionResult OperationReport::DetermineSid(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PSID const tCurrentSid, PSID & tResultantSid)
Expand Down

0 comments on commit 4a7601a

Please sign in to comment.