more fixes

This commit is contained in:
TheTank20 2023-12-21 12:46:26 -05:00
parent d3e9089700
commit 823e44ec56
1 changed files with 17 additions and 17 deletions

View File

@ -402,7 +402,7 @@ void safeStrncat(char* destination, const char* source, size_t size) {
strncat(destination, source, size - destLen - 1); // -1 for the null terminator strncat(destination, source, size - destLen - 1); // -1 for the null terminator
} else { } else {
// Handle buffer overflow error // Handle buffer overflow error
std::cerr << "Error: Buffer overflow during strncat operation." << std::endl; std::cout << "An error occurred at safeStrncat: Buffer overflow during strncat operation." << std::endl;
} }
} }
#pragma clang diagnostic pop #pragma clang diagnostic pop
@ -412,7 +412,7 @@ bool IsProcessRunning(const wchar_t* processName)
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot == INVALID_HANDLE_VALUE) if (snapshot == INVALID_HANDLE_VALUE)
{ {
std::cerr << "Failed to create process snapshot." << std::endl; std::cout << "An error occurred at IsProcessRunning: Failed to create process snapshot." << std::endl;
return false; return false;
} }
@ -421,7 +421,7 @@ bool IsProcessRunning(const wchar_t* processName)
if (!Process32FirstW(snapshot, &processEntry)) if (!Process32FirstW(snapshot, &processEntry))
{ {
CloseHandle(snapshot); CloseHandle(snapshot);
std::cerr << "Failed to retrieve process information." << std::endl; std::cout << "An error occurred at IsProcessRunning: Failed to retrieve process information." << std::endl;
return false; return false;
} }