mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 04:04:18 +02:00
Coderabbit fixes
This commit is contained in:
1 parent
b5e5858e1d
commit
6dc4e59052
2 files changed
+23
-7
No files matched your search
@@ -165,8 +165,12 @@ static bool cache_init_core() {
|
|||||||
db = nullptr;
|
db = nullptr;
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
std::filesystem::remove(path, ec);
|
std::filesystem::remove(path, ec);
|
||||||
std::filesystem::remove(std::filesystem::path{file + "-wal"}, ec);
|
auto wal = path;
|
||||||
std::filesystem::remove(std::filesystem::path{file + "-shm"}, ec);
|
wal += "-wal";
|
||||||
|
std::filesystem::remove(wal, ec);
|
||||||
|
auto shm = path;
|
||||||
|
shm += "-shm";
|
||||||
|
std::filesystem::remove(shm, ec);
|
||||||
ret = sqlite3_open(file.c_str(), &db);
|
ret = sqlite3_open(file.c_str(), &db);
|
||||||
if (ret != SQLITE_OK) {
|
if (ret != SQLITE_OK) {
|
||||||
Log.error("Failed to recreate database: {}", sqlite3_errmsg(db));
|
Log.error("Failed to recreate database: {}", sqlite3_errmsg(db));
|
||||||
|
|||||||
+17
-5
@@ -578,11 +578,23 @@ std::string FormatHostStackTrace(unsigned framesToSkip) {
|
|||||||
&module) != 0 &&
|
&module) != 0 &&
|
||||||
module != nullptr) {
|
module != nullptr) {
|
||||||
moduleBase = reinterpret_cast<DWORD64>(module);
|
moduleBase = reinterpret_cast<DWORD64>(module);
|
||||||
wchar_t modulePathBuffer[MAX_PATH] = L"";
|
std::wstring modulePathBuffer(MAX_PATH, L'\0');
|
||||||
const DWORD length = GetModuleFileNameW(module, modulePathBuffer, MAX_PATH);
|
for (;;) {
|
||||||
if (length != 0) {
|
const DWORD length =
|
||||||
modulePath = RuntimeConfigFile::PathToUtf8(
|
GetModuleFileNameW(module, modulePathBuffer.data(), static_cast<DWORD>(modulePathBuffer.size()));
|
||||||
std::filesystem::path(std::wstring(modulePathBuffer, length)));
|
if (length == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (length < modulePathBuffer.size()) {
|
||||||
|
modulePathBuffer.resize(length);
|
||||||
|
modulePath = RuntimeConfigFile::PathToUtf8(std::filesystem::path(modulePathBuffer));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Truncated; retry with a larger buffer up to the extended path limit.
|
||||||
|
if (modulePathBuffer.size() >= 32768) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
modulePathBuffer.resize(modulePathBuffer.size() * 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user